Colway Solutions
Modbus Member Logo

How To: Change Modbus Variables

You can change values at one addresses at a time using the Data Display Panel of an MDG form. The WriteSingleXXX function codes are used for writing to the device using this method. If you intend to change values of multiple addresses at a time use the Write->Coils and Write->Holding Registers menu options instead.


1. Setup a MDG form to acquire data for the addresses of interest from the Modbus device.
2. Using the left mouse button, within the Data Display Panel double click the address or the value part of the Modbus variable whose value is to be changed.

Depending on the Data Type of the address being modified a popup Window appears using which a new value can be written to this address.

  • The Write Single Register popup appears if the data type is Holding Register. In this popup, enter the value to be written to this address in the New Value text box. Press OK.

  • The Write Single Coil popup appears if the data type is Coil. In this popup, set the new state for the coil to On or Off by clicking on the appropriate radio button. Press OK.
  • 3. Verify that the new value was indeed written to the device by examining the readback value in the Data Display Panel (ensure polling is enabled before doing this
    An attempt to write to a Discrete Input or an Input Register will cause an error message to be displayed.

    See Also

    Topic link How To: Change the state of multiple Coils at once
    Topic link How To: Change values of multiple Holding Registers at once
    Privacy Policy Site Map FAQ Contact Us