LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write Multiple Registers Not working

Solved!
Go to solution

I have this program where I write the hex value 3000 to Modbus device starting from address 256. So I create a array of 16 values each value with the hex value 3000. And I write it to Modbus address starting at 256. Now there is no error. But there should be a change happening in the device which is 16 Leds turning off. But that is not happening. But then I put it in highlight execution mode where and then it writes correctly and all LEDs are turned off. Why is this happening. Kindly help me.  

0 Kudos
Message 1 of 6
(871 Views)
Solution
Accepted by topic author govindsankar

If things work in execution highlighting mode, you have a race condition or timing issues. We cannot tell more without seeing your code.

0 Kudos
Message 2 of 6
(840 Views)

I have attached the program and the problem is not a timing issue. I have tried various different timings and it doesnt work. In the program you will see a state diagram structure and there are two states that is important, one is config modbus and the other is deconfig modbus and in both conditions when you write values to modbus write and in config modbus u write a certain set of values to configure the device to a certain state and in deconfig modbus you deconfigure it to bring it back to normal state. The config modbus happens correctly whereas the deconfig modbus doesnt work. Kindly help me. Thank you. 

0 Kudos
Message 3 of 6
(802 Views)

You are using the same library (Plasmionique) to do a Modbus write for both operations. One is working, one is not. You are either not sending valid data for whatever command you want the device to perform or you are getting an error. Start by probing the error wire coming out of the "Deconfig modbus" Modbus write.

0 Kudos
Message 4 of 6
(791 Views)

That is the thing, I am not getting any error. Thats why I am confused. 

0 Kudos
Message 5 of 6
(768 Views)

Ok you are right, sorry my mistake. It was timing issue. I tried 3 seconds and didnt it take it any higher. But it was actually five seconds, because there are 16 channels and to configure them all at once 5 seconds was needed. So my mistake. 

0 Kudos
Message 6 of 6
(754 Views)