WOLFRAM SYSTEM MODELER

ReadAndWrite

Basic example that demonstrates how to write to and read from items on an OPC server

Diagram

Wolfram Language

In[1]:=
SystemModel["OPCClassic.Examples.ReadAndWrite"]
Out[1]:=

Information

This example shows the principles of how to use the OPC Classic Library to connect to an OPC server for data acquisition.

Components writeReal, writeInteger, and writeBoolean are blocks for writing data of their respective type to items on an OPC server. In this example, the server is Matrikon.OPC.Simulation.1, which is a Matrikon OPC server for simulation and testing. The input to a block is the signal that is to be sampled and written to the server, in this case a sine wave, a real-to-integer converted sine wave, and a Boolean pulse signal. In this example, all blocks write to and read from bucket brigade items of different types.

Components readReal, readInteger, and readBoolean are blocks for reading data of their respective types from the server. Since the read and write blocks for each specific type both connect to the same item, the read blocks sample the same signal that is written to the server.

This is a model that shows the principles of reading and writing data from an OPC server with the OPCClassic

Plot of the signals of type Real that are written to and read from the MatrikonOPC Server.


This is a model that shows the principles of reading and writing data from an OPC server with the OPCClassic

Plot of the signals of type Integer that are written to and read from the MatrikonOPC Server.


This is a model that shows the principles of reading and writing data from an OPC server with the OPCClassic

Plot of the signals of type Boolean that are written to and read from the MatrikonOPC Server.

Components (10)

sine

Type: Sine

booleanPulse

Type: BooleanPulse

realToInteger

Type: RealToInteger

opcServer

Type: OPCServer

readReal

Type: Read

readInteger

Type: Read

readBoolean

Type: Read

writeReal

Type: Write

writeBoolean

Type: Write

writeInteger

Type: Write