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.

Changing Values via Modbus

If the modification is to be made in script mode, the following script can be used:

connections.getfromid('J8L9n/gRsYtZHNkrombr0f7oD14=').writesinglecoil(0, true)

We are learning from you!

Did you find this article helpful?

Be enlightened!

Do you need more support?

Peakboard Youtube icon Visit our YouTube channel

Our numerous videos for beginners and advanced users explain exactly how to design your dashboard.

Peakboard Templates icon Visit the Peakboard Templates

Download our templates for various use cases for free.

Peakboard icon Visit www.peakboard.com

Find out all about Peakboard and browse our different use cases and success stories.