WOLFRAM SYSTEM MODELER

RPiInteraction

Example that demonstrates the interaction of an OPC UA server with a Raspberry Pi

Diagram

Wolfram Language

In[1]:=
SystemModel["OPCUA.Examples.RPiInteraction"]
Out[1]:=

Information

This example shows the principles of how to use the OPCUA Library to read and write data to a Raspberry Pi. 

By using a readReal, named in this example readCPUTemp, you can read the temperature of the CPU of the Raspberry Pi. This can be done if the OPC UA server has implemented the neccessary features, as the exampleServer from open62541 has done. See Getting Started on how to set up such a server.

Using another component writeBoolean, named writeLEDStatus, in combination with a booleanPulse, you can turn an LED on the Raspberry Pi on and off. You can read the status of the LED by using a readBoolean component, reading the value of the node being written to.

Plot of the values of type Real that are read from node 97 on the Raspberry Pi OPC UA server, corresponding to the CPU temperature of the Raspberry Pi .


Plot of the signals of type Boolean that are written to node 98 on the Raspberry Pi OPC UA server, corresponding to turning on and off an LED on the Raspberry Pi.

Components (5)

opcServer

Type: OPCUAServer

Description: A model used for setting up server parameters

readCPUTemp

Type: Read

Description: A block for reading data from items on an OPC server at intervals determined by parameter samplePeriod

readLEDStatus

Type: Read

Description: A block for reading data from an item on an OPC server at intervals determined by parameter samplePeriod

writeLEDStatus

Type: Write

Description: A block for writing data to items on an OPC server at intervals determined by parameter samplePeriod

booleanPulse

Type: BooleanPulse

Description: Generate pulse signal of type Boolean