How can we help?
OPC UA Constants and Variables
Overview
OPC UA variables are used to hold data retrieved from an OPC UA server. Variables must exist in DataXchange and then be mapped to OPC UA items.
OPC UA Source Variables
DataXchange includes the following variables predefined:
Variable Name | Notes | |
---|---|---|
Alarm Code [OPCUA.alarm_code] | Returns the value mapped as the alarm code | |
Alarm Detail [OPCUA.alarm_detail] | Returns the value mapped to the alarm description | |
Alarm Status [OPCUA.alarm_status] | Returns the value mapped to the alarm status | |
Alarms [OPCUA.alarms] | Returns the Alarm Codes and Alarm Details for active alarms on the machine. Either Alarm Code or Alarm Detail must be mapped. If only one is mapped, the other will report NA in expressions. More information about using this variable in expressions can be found here. | |
Cycle Status [OPCUA.cycle_status] | Returns the value mapped to the cycle status | |
E Stop [OPCUA.estop] | Returns the value mapped to the e stop | |
Part Count [OPCUA.part_count] | Returns the value mapped to the part count | |
Program Number [OPCUA.program_number] | Returns the value mapped to the program number | |
Connected Time [OPCUA.connected_time] | Returns the amount of time in seconds since a successful connection to the Source. |
The following variables hold the value for the previous poll from the device.
Variable Name | Syntax | |
---|---|---|
Alarm Code (Previous) | [OPCUA.prev_alarm_code] | |
Alarm Detail (Previous) | [OPCUA.prev_alarm_detail] | |
Alarm Status (Previous) | [OPCUA.prev.alarm_status] | |
Alarms (Previous) | [OPCUA.prev_alarms] | |
Connected Time (Previous) | [OPCUA.prev_connected_time] | |
Cycle Status (Previous) | [OPCUA.prev_cycle_status] | |
E Stop (Previous) | [OPCUA.prev_estop] | |
Part Count (Previous) | [OPCUA.prev_part_count] | |
Program Number (Previous) | [OPCUA.prev_program_number] |
OPC UA Custom Variables
In addition to using the predefined variables, DataXchange has the ability to create custom variables for the OPC UA source. OPC UA variables can be added or modified on the DataXchange tab by selecting the Variable button and then the OPC UA menu item.
Custom variables will then show in the expression builder when defining expressions. For example, the following will show after an custom variable named stack_light was created for OPC UA.
Variable Name | Notes | |
---|---|---|
Custom Variable [OPCUA.stack_light] | Returns the data from the custom mapping variable |
The following variables hold the value for the previous poll from the device.
Variable Name | Syntax | |
---|---|---|
Custom Variable (Previous) | [OPCUA.prev_stack_light] |
Once the variables have been defined they need to be mapped to OPC UA data items. The mapping is done at an individual equipment level since this may vary from equipment to equipment.