System variables - ESM tasks, HMI clients and AlarmProgram status
ESM task handling
Available for AXC F x152, RFC 4072S, RFC 4072R
Programs and program parts are treated as tasks in PLCnext Engineer. Individual tasks are coordinated and processed in the Execution and Synchronization Manager (ESM).
The ESM_DATA system variable can be used to retrieve information on the task handling of the ESM. The ESM_DATA system variable is a system variable organized as a data structure.
Task handling system variables
Note: Since the system variable ESM_DATA
is updated by the GLOBALS
task, the corresponding IEC 61131-3 system variables were usually not updated when the event task is executed. Therefore, in case of IEC 61131-3 programming the function block GET_EXCEPTION_INFOS
must be used to retrieve information which exception was thrown.
System variable | Type | Description |
ESM_DATA | ESM_DAT | Data structure |
└ ESM_COUNT | USINT | Number of ESMs (one ESM per processor core) |
└ ESM_INFOS | ESM_INFO_ARRAY | Information on ESM [1...2] [1] |
└ [1]...[2] | ESM_INFO | |
└ TASK_COUNT | UINT | Number of tasks that have been configured for the ESM |
└ TICK_COUNT | UDINT | Always 0
However when a request for this system variable is made from a REST client, the HMI server does not return the value of that system variable (which is always zero), but instead it returns a different value that looks like a tick count. |
└ TICK_INTERVAL | UDINT | Always 0 |
└ TASK_INFOS | TASK_INFO_ARRAY | Information on task [1...16] [1] |
└ [1]...[16] | TASK_INFO | |
└ INTERVAL [2] | LINT | For cyclic tasks: time interval in μs; for acyclic tasks: 0 |
└ PRIORITY [2] | INT | Priority of task |
└ WATCHDOG [2] | LINT | Watchdog time in μs; no watchdog: 0 .The watchdog time will be defined for the sum of execution duration and delay time. If the watchdog time is exceeded the watchdog will trigger. |
└ LAST_EXEC_DURATION | LINT | Execution duration of the task in the previous cycle in μs (including interruptions by higher priority tasks) |
└ MIN_EXEC_DURATION | LINT | Minimum execution duration of the task in μs (including interruptions by higher priority tasks) |
└ MAX_EXEC_DURATION | LINT | Maximum execution duration of the task in μs (including interruptions by higher priority tasks) |
└ LAST_ACTIVATION_DELAY | LINT | Delay time of the task in the previous cycle in μs (delay occurs if higher priority tasks are pending at the time of task activation) |
└ MIN_ACTIVATION_DELAY | LINT | Minimum delay time of the task in μs (delay occurs if higher priority tasks are pending at the time of task activation) |
└ MAX_ACTIVATION_DELAY | LINT | Maximum delay time of the task in μs (delay occurs if higher priority tasks are pending at the time of task activation) |
└ EXEC_TIME_THRESHOLD [2] | LINT | Threshold value that you can define for the sum of execution duration and delay time |
└ EXEC_TIME_THRESHOLD_CNT | UDINT | If the defined EXEC_TIME_THRESHOLD value is exceeded, the value of the EXEC_TIME_THRESHOLD_CNT variable is incremented |
└ NAME [2] | STRING | Task name |
└ EXCEPTION_COUNT | USINT | Number of exceptions |
└ EXCEPTION_INFOS | ESM_EXCEPTION_INFO_ARRAY | Information on exceptions [1...2] |
└ [1]...[2] | ESM_EXCEPTION_INFO | |
└ TYPE_ID | UDINT |
ID of the exception 0 = None |
└ SUB_TYPE | STRING | Subtype of the exception (for example, std::exception , Arp::System::Commons::ArgumentException ) |
└ SUB_TYPE_ID | UDINT | Provides detailed information for ARP exceptions (if TYPE_ID = 1)0x4000 = PLC exception 0x4001 = PLC division by zero exception 0x4002 = PLC index out of range exception 0x4003 = PLC stack overflow exception 0x4004 = PLC string error exception |
└ TASK_NAME | STRING | Name of the task in which the exception occurred |
└ PROGRAM_NAME | STRING512 | Name of the program instance in which the exception occurred |
└ INFORMATION | STRING512 | Information on the exception that occurred |
- The AXC F 1152 supports only ESM 1 with 8 tasks.
- These system variables can be set in the PLCnext Engineer by means of the Tasks and Events editor.
HMI client connections to the PLCnext Engineer web server
Available for AXC F x152, RFC 4072S, RFC 4072R
An HMI application in PLCnext technology is executed on the PLCnext Engineer embedded HMI server. There are system variables for handling client connections to the HMI web server. These system variables are organized as a data structure:
- The HMI_STATUS (up to 2021.9) and HMI_STATUS2 (from 2022.0 LTS) system variables can be used to retrieve information on the client connections to the HMI web server.
- The HMI_CONTROL system variable can be used to disconnect a client from the HMI web server.
HMI client connection system variables
System variable | Type | Description |
HMI_STATUS (up to 2021.9) | HMI_STATUS_TYPE | Data structure |
└ CLIENT_COUNT | UINT | Number of currently existing client connections to the HMI web server |
└ CLIENTS | HMI_STATUS_ARRAY | Information on existing client connections |
└ [1]...[256] | HMI_STATUS_STRUCT | Client connections 1...256 |
└ SESSION_ID | STRING | Session ID of the client connection |
└ STATION_ID | STRING | Station ID of the client |
└ LAST_REQ | LINT | Time of the last request from the client |
└ IP_ADDRESS | IP_ADDRESS_ARRAY | IP address of a client in hexadecimal format, e.g. 192.168.1.100 would be [C0 ].[A8 ].[01 ].[64 ] |
└ [0]...[3] | BYTE | |
HMI_STATUS2 (from 2022.0 LTS) | HMI_STATUS_TYPE | Data structure |
└ CLIENT_COUNT | UINT | Number of currently existing client connections to the HMI web server |
└ CLIENTS | HMI_STATUS_ARRAY | Information on existing client connections |
└ [1]...[256] | HMI_STATUS_STRUCT | Client connections 1...256 |
└ SESSION_ID | STRING | Session ID of the client connection |
└ STATION_ID | STRING | Station ID of the client |
└ LAST_REQ | LINT | Time of the last request from the client |
└ IP_ADDRESS | IP_ADDRESS_ARRAY | IP address of a client in hexadecimal format, e.g. 192.168.1.100 would be [C0 ].[A8 ].[01 ].[64 ] |
└ [0]...[3] | BYTE | |
└ STATION_NUM | UINT | Station ID as number |
HMI_CONTROL | HMI_CONTROL_TYPE | Data structure |
└ CLIENTS | HMI_CONTROL_ARRAY | Information on existing client connections [1 ... 256] |
└ [1]...[256] | HMI_CONTROL_STRUCT | |
└ DISABLE | BOOL | By setting this to true , the selected client is disconnected from the HMI web server |
AlarmProgram status
Available from firmware version 2025.0 and PLCnext Engineer 2025.0
The system variable ALARM_PROGRAM_STATUS belongs to the configurable alarms that can be configured via the PLCnext Engineer software. It displays information on the program instances of the type AlarmProgram
.
Further information on configurable alarms can be found in Alarms and PLCnext Engineer help.
Diagnostic information is provided for each AlarmProgram
instance in the ALARM_PROGRAM_STATUS variable that appears in the Data List of PLCnext Engineer. This information can be used to determine the amount of time an ESM task cycle spends evaluating alarm expressions versus performing other task logic, such as evaluating IEC 61131-3 control programs. These values can help to configure a real-time schedule, for example, by adjusting the task interval or number of alarm expressions in the project.
System variable | Type | Description |
ALARM_PROGRAM_STATUS | ALARM_PROGRAM_STATUS_TYPE | Data structure |
└ ALARM_PROGRAM_INFO_ARRAY | ARRAY[1..16] OF ALARM_PROGRAM_INFO_TYPE | Each of the 16 elements of the array contains diagnostic information for one AlarmProgram instance. Note: Currently, only one program instance is supported by PLCnext Engineer. The information will appear in array slot 1. The remaining 15 slots will contain empty or zero values in their fields. |
└ALARM_PROGRAM_INFO_TYPE | STRUCT | The fields in the ALARM_PROGRAM_INFO_TYPE struct contain duration values that convey how long the alarm program spent processing the alarm expressions. The duration values are displayed in microseconds. |
└ NAME | STRING[512] | AlarmProgram nameThe canonical name of the AlarmProgram instance, for example Arp.Services.AlarmServer/MyAlarmProgram |
└ LAST_EXEC_DURATION | LINT | Last execution duration The number of microseconds spent processing alarm expressions during the last ESM task cycle. |
└ MIN_EXEC_DURATION | LINT | Minimum execution duration The minimum duration (in microseconds) for processing alarm expressions in all task cycles since the device was started. |
└ MAX_EXEC_DURATION | LINT | Maximum execution duration The maximum duration (in microseconds) for processing alarm expressions in all task cycles since the device was started. |
See also