System variables are variables that are related to SIA such as UUID and time.
This articles contains all the accessible system variables that can be used when scripting and processing in SIA.
UID and name referencing
Any item or instance can be referenced to by calling it by its UID or name. This makes information, parameters and values from instances and items accessible all across SIA.
Reference | Description | Example |
---|---|---|
UID | An instance and item can have a UID. By referencing to this it is possible to access its variables. Check the following articles for setting UIDs for instances and items |
UID: BOTTLE_COUNTER (value variable) %BOTTLE_COUNTER.VALUE% |
NAME | The item or instance the variable should point at can also be referenced by its name. Spaces will be replaced by _ and special characters removed. |
NAME: Speed setpoint (value variable) %SPEED_SETPOINT.VALUE% |
Time variables
%VARIABLE% | Description | Example |
---|---|---|
VALUE.TIME | Timestamp of the value associated to an item. | 2021-12-31T14:00:00 |
TIME | Current system time in UTC. Default format: yyyy-MM-ddTHH:mm:ss |
%TIME% |
TIME_UTC |
||
NOW | 2021-12-31T14:00:00 | |
TIME_LOCAL |
Current system time in local time. Default format: yyyy-MM-ddTHH:mm:ss |
%TIME_LOCAL% |
2021-12-31T15:00:00 | ||
EPOCH_TIME | The epoch / Unix timestamp which is given in s since January 1, 1970 | %EPOCH_TIME% |
UNIX_TIME | 1640959200 | |
EPOCH_TIME_MS | The epoch / Unix timestamp which is given in s since January 1, 1970 given in ms | %EPOCH_TIME_MS% |
UNIX_TIME_MS | 1640959200000 |
Formatting of time
Time variables can be formatted so you can tailor and format so it matches into your requirements and needs.
In order to use time format you have to apply .FORMAT to the time format:
%TIME.FORMAT("yyyy-MM-ddTHH:mm:ss")% %VALUE.TIME.FORMAT("yyyy-MM-ddTHH:mm:ss")%
The following tables shows all the format specifiers:
Format specifier | Description |
---|---|
d | The day as number without a leading zero (1 to 31) |
dd | The day as number with a leading zero (01 to 31) |
ddd | The abbreviated localized day name (e.g. 'Mon' to 'Sun') |
dddd | The long localized day name (e.g. 'Monday' to 'Sunday') |
M | The month as number without a leading zero (1-12) |
MM | The month as number with a leading zero (01-12) |
MMM | The abbreviated localized month name (e.g. 'Jan' to 'Dec') |
MMMM | The long localized month name (e.g. 'January' to 'December') |
yy | The year as two digit number (00-99) |
yyyy | The year as four digit number |
Format specifier | Description |
---|---|
h | The hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display) |
hh | The hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display) |
H | The hour without a leading zero (0 to 23, even with AM/PM display) |
HH | The hour with a leading zero (00 to 23, even with AM/PM display) |
m | The minute without a leading zero (0 to 59) |
mm | The minute with a leading zero (00 to 59) |
s | The second without a leading zero (0 to 59) |
ss | The second with a leading zero (00 to 59) |
z | The milliseconds without leading zeroes (0 to 999) |
zzz | The milliseconds with leading zeroes (000 to 999) |
AP or A | Interpret as an AM/PM time. AP must be either "AM" or "PM" |
ap or a | Interpret as an AM/PM time. ap must be either "am" or "pm" |
SIA variables
%VARIABLE% |
Description |
Example |
---|---|---|
UUID |
The system UUID |
%UUID% d20c87c7-7fc5-4705-941b-c1c0e88facb6 |