Modbus-Writing into Holding Registers and Coil


Thread Starter



I have Gas Detection system that communicates through Modbus. I have my HMI to read and write into this Gas Rack Modbus registers. So far I used my Modbus communication to read datas from Gas Rack. Now I would like to write into the Modbus Registers. How do I do this? I would like to do the following:

1) Set the Modbus Register value 00025 to 1
2) Set the Modbus Register value 00057 to 1
3) Holding Register 4X has to be set 1200 hex.

I know how to send this using Modscan. I would like to know the step by step procedure how do I write to these registers? How do I write in my program (I am using Optoscript) to make this happen-Just a general idea only. Please help me.
Look for the information in the "bible" PI-MBUS-300.PDF (see MODBUS.ORG for example, or PI-MBUS-300 contains all the definitions of the protocol.