System variables - ESM tasks and HMI clients

ESM task handling

Available for  AXC F x152RFC 4072SRFC 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
1 = ARP exception (see details in SUB_TYPE and SUB_TYPE_ID)
2 = STD exception (see details in SUB_TYPE)
3 = Unknown exception
4 = Signal
5 = Task WatchDog

          └ 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
  1. The AXC F 1152 supports only ESM 1 with 8 tasks.
  2. 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 x152RFC 4072SRFC 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

 

 

 


• Published/reviewed: 2024-12-10  ☃  Revision 075 •