OPC-UA

Steps that integrate with OPC-UA compatible devices and systems.

This tab provides steps that integrate with OPC-UA compatible devices and systems.


On PLC

This trigger step pauses the scenario until a signal is received from a specific PLC node. The received value is saved to the coding scenario data and can be used by subsequent steps.

ParameterTypeDescription
PLC deviceMandatoryThe PLC device that this step listens to.
Node idMandatoryThe node id of the PLC item that this step listens to.

Examples

Example 1: Print-and-Apply with a Handshake to the Line PLC

The PLC that controls the conveyor stops each carton at the labeling position and sets its “print request” node. The On PLC step receives the signal. The Check If Production Running step verifies whether there is an active production on the line. If a production is running, the Send print job to printer step sends the label to the print-and-apply system. The Write PLC values step then resets the “print request” node to false, which tells the PLC that the label has been sent. The PLC then releases the carton and stops the next one at the labeling position.

Example 2: Printing a Pallet Label and Sharing the SSCC with the Palletizer

When the palletizer finishes a pallet, its PLC sets the “pallet complete” node. The On PLC step receives the signal. The Check If Production Running step verifies whether there is an active production on the line. If a production is running, the Send print job to printer step sends the pallet label to the printer. The Create logistic unit from printer log step creates a new logistic unit from the resulting printer log entry. The Write database value to OPC UA node step then writes the SSCC of the new logistic unit to the PLC, which passes it to the scanner that verifies the applied pallet label before the pallet leaves the line.


On PLC value match

This trigger step pauses the scenario until the value of a specific PLC node changes to an expected value. Unlike the On PLC step, which triggers on every value change of the node, this step ignores all other values. The received value is saved to the coding scenario data and can be used by subsequent steps.

ParameterTypeDescription
PLC deviceMandatoryThe PLC device that this step listens to.
Node idMandatoryThe node id of the PLC item that is monitored.
Expected valueMandatoryThe value the node must reach to trigger this step.
Ignore caseMandatoryIf enabled, the value comparison ignores letter case. Enabled by default.

Examples

Example 1: Stopping the Production when the PLC Reports the End of a Batch

The PLC of the filling line reports its state in a “line state” node, for example RUNNING, PAUSED, FAULT, or BATCH_END. When the last container of the batch has been filled, the PLC sets the node to BATCH_END. The On PLC value match step, with Expected value set to BATCH_END, receives the signal. The Stop Production step stops the production on the line, and the Write PLC values step sets the “labeling ready” node of the PLC to false, so the line cannot start again until a new production is started.

Other states, for example a short PAUSED during a label roll change, do not trigger the scenario, so the production is not stopped by mistake.

Example 2: Labeling Different Packaging Types Reported by the PLC

Cartons and trays run on the same conveyor and are labeled by different printers. Before each package reaches the labeling station, the PLC writes its packaging type to a “packaging type” node, for example CARTON or TRAY, and clears the node again once the package has passed. Two coding scenarios listen to the same node: the first uses the On PLC value match step with Expected value set to CARTON, the second with TRAY. In each scenario, the Check If Production Running step verifies whether there is an active production on the line, and the Send print job to printer step sends the label to the printer for that packaging type.

Limitations

  • The value is compared as text and must match exactly, apart from letter case if Ignore case is enabled. For example, the expected value 1 does not match 1.0, and true does not match 1. Check how the PLC reports the value before configuring the step.
  • Only one expected value can be configured per step. To react to several values, create a separate coding scenario for each value.
  • The step triggers when the node changes to the expected value. If the PLC writes the same value again, the node does not change, and the scenario is not triggered again.

Write PLC values

This action step writes a fixed, configured value to an OPC-UA node. Use it when the value to write is always the same, unlike Write database value to OPC UA node, which writes a value read from the database.

ParameterTypeDescription
PLC deviceMandatoryThe PLC device to write to.
Node idMandatoryThe node id of the OPC-UA item to write to.
OPC UA node valueMandatoryThe value to write to the node.

Examples

Example 1: Writing a Fixed Value when Production Starts via OPC-UA

When a signal is received from the configured OPC-UA node, the On opcua step triggers the scenario. The Start Production step starts production on the line, and the Send print job to printer step sends the label to the printer. The Write OPC UA values step then writes the configured value to the target node.


Read PLC values

This action step reads the current value of a PLC item on demand and makes it available to subsequent steps in the same scenario run. Unlike the On opcua and On opcua value match trigger steps, which wait for a value to change, this step actively reads the value at the moment it is executed. Use it when the production line exposes a product or order identifier as a PLC value, and a subsequent step, for example Select product or Select production order, needs this value to find the matching record in the master data.

The step works with both OPC-UA and Modbus devices, in the same way as the Write PLC values step.

ParameterTypeDescription
PLC deviceMandatoryThe PLC device to read from. This can be an OPC-UA or a Modbus device.
Node idMandatoryThe item to read: the node id of an OPC-UA device or the register of a Modbus device.

Examples

Example 1: Selecting a Product based on a PLC Value

When the value of the configured PLC item matches the expected value, the On PLC value match step triggers the scenario. The Read PLC values step reads the current product identifier from the PLC. The Select product step uses this value to identify the matching product from the master data, and the Send print job to printer step sends the label to the printer. The Write database value to OPC UA node step then writes the selected column of the product back to the configured node.

Example 2: Selecting a Production Order based on a PLC Value

When a signal is received from the configured PLC item, the On PLC step triggers the scenario. The Write PLC values step writes a fixed value to the PLC, for example to reset an error flag. The Read PLC values step reads the current order identifier from the PLC. The Select production order step uses this value to identify the matching production order from the master data. The SQL Executor step then runs an SQL query against an external database, for example to store data of the selected production order.

Limitations

  • If the read fails (e.g. the device or item is unreachable), the step fails and the error is reported in the scenario logs.

Write database value to OPC UA node

This action step writes a value from a database table to an OPC-UA node. Use it to share production data, for example production order or logistic unit information, with external PLCs and devices during the print process. When the step is executed, the current value of the selected column for the currently selected record is written to the selected node.

ParameterTypeDescription
DB tableMandatoryThe database table containing the value to write: Product, Production Order, Logistic Unit, ect.
DB columnMandatoryThe column of the selected table whose current value is written to the node.
OPCUA deviceMandatoryThe OPC-UA device to write to.
Node idMandatoryThe node id of the OPC-UA item to write to. The list shows the nodes configured for the selected device.

Examples

Example 1: Sharing Production Data after Printing

When print jobs are imported, the On print jobs import step triggers the scenario. The Send print job to printer step sends the label to the printer. The Write database value to OPC UA node step then writes the current value of the selected column, for example from the production order, to the configured OPC-UA node.

Example 2: Sharing Logistic Unit Data with a PLC

When a new printer log entry arrives, the On printer log step triggers the scenario. The Create logistic unit from printer log step creates a logistic unit from the log entry. The Write database value to OPC UA node step then writes the selected column of the logistic unit, for example its identifier, to the configured OPC-UA node.

Limitations

  • If the write fails (e.g. the node is unreachable or the value type does not match the node’s type), the step fails and the error is reported in the scenario logs.