Modbus writing using channels


extoan

Recommended Posts

I have some panel meters / batchers working with Modbus RTU and I would like to control it with DaqFactory.

I was able to create separate channels for reading and writing to same register:

LoC - Read Holding S16(3)

W_LoC - Set Register S16(6)

Reading is working fine but I have some problem with writing. When I use "Button Component" and "Increment" action, it is working fine and correct value is written. The same thing is if I use action "Set to Advanced". In both cases W_LoC Action channel is selected. The problem is when using Button Component "Set To" - whatever I write I get value 1 written to register. Similar problem I get with Edit Box Component. In this case whatever value is written in edit box value 0 is sent. When I try using Combo box for this I didn't even get any write frame (looking at the Modbus monitor).

Can you help? I would really like to use just channels and not device functions if possible.

Link to comment
Share on other sites

Here is an example attached. I have removed all except problem. Please let me know what am I doing wrong.

Please can you post some working project example or read/write RTU with single holding register. Please put in it different ways how value can be transmitted (using button, edit box, drop down selection etc.). Thanks.

SIMEX_SWE_73_test.ctl

Link to comment
Share on other sites

Your sample worked perfectly for me. What release of DAQFactory are you running? Try deleting the file pmodbusrtu.dll from your DAQFactory directory and then reinstalling DAQFactory on top of your existing installation.

Link to comment
Share on other sites

Having separate ones gives you clear separation between the setting of the value and the readback. Using just one channel, you will get the output variable and the readback in the same channel. This can be confusing sometimes, especially if the value is being changed internally to the PLC. For example, if you had the channel tied to a knob, the knob would move on its own as the PLC changed the value. If the PLC was changing it rapidly, while you were trying to adjust it manually with the knob, you would end up fighting it, never being able to actually move the knob all to your desired setting.

Again, this might be what you want, but as I said, often it is not.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.