Instance variables are variables that are linked to an instance such as its name and address. These can be very handy to use when customizing a payload in a mapping or doing logic.
This articles contains all the accessible instance variables that can be used when scripting and processing in SIA.
System variables describes how to reference variables to an instance by calling it by its name or UID so instead of %INSTANCE% the UID or name of a instance can be used.
To identify variables they need to be wrapped in % e.g. %BOTTLE_MACHINE%.
Variables are case-insensitive
Instance referencing
An Instance can be referenced in various ways depending on their use, as it can be seen in the table below.
Using one of the below references without any additional parameters, will return its own NAME.
Identifier | Description | Example |
---|---|---|
INSTANCE | Reference the Instance itself where it's been used from | %INSTANCE.NAME% |
MyPLC | ||
INSTANCE_MASTER | Reference the Master Instance in a mapping | %INSTANCE_MASTER.UID% |
PLC_001 | ||
INSTANCE_SLAVE INSTANCE_RECEIVER |
Reference the Slave Instance in a mapping | %INSTANCE_SLAVE.UID% |
MQTT_BROKER_001 |
Parameters list
All the parameters and information that can be accessed from an instance is described in the table:
%VARIABLE% | Description | Example |
---|---|---|
ID | The auto-generated ID of the instance assigned by SIA | %INSTANCE.ID% |
5 | ||
NAME | Name of the instance | %INSTANCE.NAME% |
Bottle machine | ||
ADDRESS | Address of the instance (IP address, Connection String, node number, ...) | %INSTANCE.ADDRESS% |
10.20.30.55 | ||
DESCRIPTION | Description of the instance | %INSTANCE.DESCRIPTION% |
"Machine for bottle handling" | ||
AVAILABLE | Availability for the device. Given in true (available) or false (unavailable) | %INSTANCE.AVAILABLE% |
true | ||
ERROR LAST_ERROR |
The text of the current error on the instance | %INSTANCE.LAST_ERROR% %INSTANCE.ERROR% |
"PLC unreachable" | ||
ENABLED | True for enabled instances & false for disabled | %INSTANCE.ENABLED% |
true | ||
UID | UID of the instance | %INSTANCE.UID% |
BOTTLE_MACHINE | ||
STORE_TIME | Default store time for the items data under the device given in minutes | %INSTANCE.STORE_TIME% |
1440 | ||
STORE_SAMPLES | Default samples to store for the items data under the device | %INSTANCE.STORE_SAMPLES% |
1000 | ||
CONNECTOR_SPECIFIC parameters | Specific values for Connectors. E.g. "Rack" & "Slot" for a Siemens Connector. Please refer to the Connectors guides for their parameters |
%INSTANCE.RACK% |
0 | ||
%INSTANCE.SLOT% | ||
1 |