WOLFRAM SYSTEM MODELER

Write

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

Wolfram Language

In[1]:=
SystemModel["OPCUA.Blocks.SamplerReal.Write"]
Out[1]:=

Information

This block writes data of type Real from the OPC UA server it is connected to. It inherits the properties of the partial model Sampler, which contains parameters such as samplePeriod, nodeID, nodeNamespace, and nodeIDType that determine how often and to which OPC node the data should be written. Only scalar nodes can be written to; i.e. no array or matrix nodes are supported.

At every sampling instant, external function  writeExternalReal is called from within the block.

Relevant Parameters

  • samplePeriod: determines how often to sample data from the OPC node
  • startTime: when the block should start to read data
  • nodeID: which OPC UA node to write data to (ID value should always be inside quotes)
  • nodeNamespace: which namespace the node is located in
  • nodeIDType: which ID type to use, numeric or string
  • uaRealType: which OPC UA Real type to use when writing data
  • uMax: if useUMax is true, then uMax is the upper limit for the written data
  • uMin: if useUMin is true, then uMin is the lower limit for the written data
  • useUMax: if true, respect upper limit uMax
  • useUMin: if true, respect lower limit uMin

Interfaces

  • u: a Real input, which is the signal to be sampled and written to the OPC UA server
  • serverID: the connector that connects the block to the OPC UA server component

Parameters (10)

samplePeriod

Value:

Type: Time (s)

Description: Sample period of component

startTime

Value: 0

Type: Time (s)

Description: First sample time instant

nodeIDType

Value:

Type: UANodeIdType

Description: The node identifier type

nodeID

Value:

Type: String

Description: The node identifier

nodeNamespace

Value:

Type: Integer

Description: The node namespace

uaRealType

Value:

Type: UAReal

Description: OPC UA type used for writing

useUMax

Value: false

Type: Boolean

Description: If true, use upper limit for written signal

uMax

Value: 1.0

Type: Real

Description: Upper limit of written signal

useUMin

Value: false

Type: Boolean

Description: If true, use lower limit for written signal

uMin

Value: 0.0

Type: Real

Description: Lower limit of written signal

Outputs (2)

sampleTrigger

Type: Boolean

Description: True, if sample time instant

firstTrigger

Type: Boolean

Description: Rising edge signals first sample instant

Connectors (2)

serverID

Type: BlockConnector

Description: The unique ID of the server the block is connected to

u

Type: RealInput

Description: Input signal to be sampled

Used in Examples (4)

ReadAndWrite

OPCUA.Examples

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

MultipleServers

OPCUA.Examples

Example that demonstrates a possible use of multiple OPC UA servers

TriggeredSampling

OPCUA.Examples

Model that samples data from an OPC UA node irregularly

TankSystem

OPCUA.Examples

A tank system model where height data is written to and read from an OPC UA node on an OPC UA server