channel indexing


Recommended Posts

I am talking to devices on modbus. I have a couple of questions.

Firstly is it possible to have a page with about 30 modbus addresses that only get read when a button is pushed. Then the user changes the values and pushes another button to write all of the changes back to the controller.

Also i would like to have a unit selection box so that the same screen would acess all of the controllers by altering the modbus id.

Cheers Paul.

Link to comment
Share on other sites

No problem, you'll just need to use some script: one to read the values into some variables, and the other to write them back.

First you'll need some variables. Create an Auto-Start sequence to declare the variables:

global coretemperature

...

Then create a sequence to read each of the variables:

coretemperature = device.mymodbus.readholdingu16(...)

and one to write:

device.mymodbus.setregisteru16(...)

(review the help on Modbus for the exact function format)

Then create two buttons, one for read, one for write that call these sequences. Create your page to display and edit the values, using the variable names you created.

To make the same page work for different IDs, you just need another variable for the current ID, which you would then use in the read/write commands. Just remember to trigger a read after updating the ID.

Link to comment
Share on other sites

Archived

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