04-04-2022 10:08 AM
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.
Solved! Go to Solution.
04-04-2022 12:13 PM
If things work in execution highlighting mode, you have a race condition or timing issues. We cannot tell more without seeing your code.
04-05-2022 10:00 AM
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.
04-05-2022 11:32 AM - edited 04-05-2022 11:33 AM
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.
04-06-2022 01:42 AM
That is the thing, I am not getting any error. Thats why I am confused.
04-06-2022 06:38 AM
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.