WOLFRAM SYSTEM MODELER
TriggeredReadAndWriteBasic example that demonstrates how to write to and read from nodes on an OPC UA server using a signal trigger |
SystemModel["OPCUA.Examples.TriggeredReadAndWrite"]
This example shows the principles of how to use the OPCUA Library to connect to an OPC UA server for data acquisition using a signal trigger.
This example requiers an OPC UA example server running on localhost. Read about how to start the example server here.
Components writeReal, writeInteger, and writeBoolean are blocks for writing data of their respective types to items on an OPC UA server. The input to a block is the signal that is to be sampled and written to the server, in this case a cosine wave, a real-to-integer converted sine wave, and a Boolean pulse signal.
Components readReal, readInteger, and readBoolean are blocks for reading data of their respective types from the server. The data is stored on nodes on the server, which is accessed by specifying the nodeID, nodeIDType, and nodeNamespace.
Plot of the signals of type Real that are written to and read from the OPC UA server.
Plot of the signals of type Integer that are written to and read from the OPC UA server.
Plot of the signals of type Boolean that are written to and read from the OPC UA server.
opcServer |
Type: OPCUAServer Description: A model used for setting up server parameters |
|
---|---|---|
readReal |
Type: TriggeredRead Description: A block for reading data from items on an OPC server at intervals determined by an external Boolean signal (trigger) |
|
readBoolean |
Type: TriggeredRead Description: A block for reading data from an OPC server at intervals determined by an external Boolean signal (trigger) |
|
writeBoolean |
Type: TriggeredWrite Description: A block for writing data to items on an OPC server at intervals determined by an external Boolean signal (trigger) |
|
writeReal |
Type: TriggeredWrite Description: A block for writing data to an item on an OPC server at intervals determined by an external Boolean signal (trigger) |
|
cosine |
Type: Cosine Description: Generate cosine signal |
|
writeInteger |
Type: TriggeredWrite Description: A block for writing data to items on an OPC server at intervals determined by an external Boolean signal (trigger) |
|
booleanPulse |
Type: BooleanPulse Description: Generate pulse signal of type Boolean |
|
realToInteger |
Type: RealToInteger Description: Convert Real to Integer signal |
|
readInteger |
Type: TriggeredRead Description: A block for reading data from an OPC server at intervals determined by an external Boolean signal (trigger) |
|
sampleTrigger |
Type: SampleTrigger[6] Description: Generate sample trigger signal |