Scripting
Changing Values via Modbus
Note:
If a shared Modbus connection already exists, the next step can be skipped and the existing connection used.
Changing values via a Modbus connection is implemented through a script. First, a Modbus data source must be created. The connection of this data source is then used, for example, to establish a connection with the control system and to change the values.
Changing Values
The following script shows how values can be changed via a Modbus connection. It is assumed that the data source has already been created.
In the block, the data source to be used for the Modbus connection is first selected. The Start Address
of the value to be changed and the new value can then be specified.
The block can be found under Publish to external systems
-> Modbus
-> Write single coil
.
If the modification is to be made in script mode, the following script can be used:
connections.getfromid('J8L9n/gRsYtZHNkrombr0f7oD14=').writesinglecoil(0, true)