Scripting

Changing Values in OPC-UA

Hint:

If a shared OPC UA connection already exists, you can skip the next step and use the existing connection.

Changing values in an OPC-UA connection can be achieved via script. First, an OPC-UA data source must be created. The connection of this data source is then used to establish a connection with the OPC-UA server and change the values.

Changing Values

The following script demonstrates how to change values via an OPC-UA connection. It assumes that the data source has already been created.

In the block, first select the connection to be used for connecting to the OPC-UA server. Then, specify the NodeID of the value to be changed and the new value along with its data type.

The block can be found under Publish to external systems -> OPC-UA -> Set variable.

Changing Values in OPC-UA

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

connections.getfromid('oi4AHK7cVuFfTFvjf/okKZLrNBc=').writevalue('ns=2;s=TestData_TestBool', 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.