PLCnext Technology System Variables
The following system variables are available for controllers of the PLCnext Technology. The variables are shown in the Data List editor of the controller node in the PLANT.
DEVICE_STATE (device state)
- The system variable DEVICE_STATE is a system variable organized as a data structure.
- You can use the DEVICE_STATE system variable to retrieve various information
about the device status of the CPU.
Click here for a description of the variable
System variable | Type | Description |
DEVICE_STATE | DEVICE_STATE_X152_TYPE | Data structure |
1 | BOARD_TEMPERATURE | SINT | Temperature inside the housing (in °C). |
1 | reserved1 | BOOL | Reserved |
1 | RAMDISK_USAGE | USINT | Current usage of the RAM memory. |
1 | CPU_LOAD_ALL_CORES | USINT | Average current utilization of all processor cores (in %). |
1 | CPU_LOAD_PER_CORE | CPU_LOAD_PER_CORE_ARRAY | Information on the utilization of
each processor core. |
1 | 1 | [1] | USINT | Current utilization of processor core 1 (in %). |
1 | 1 | [2] | USINT | Current utilization of processor core 2 (in %). |
1 | 1 | [3] | USINT | Current utilization of processor core 3 (in %). |
ESM_DATA (task handling)
- The system variable ESM_DATA is a system variable organized as a data structure.
- You can use the ESM_DATA system variable to retrieve information about the ESM's
(Execution & Synchronization Manager) task handling.
Click here for a description of the variable
System variable | Type | Description |
ESM_DATA | ESM_DAT | Data structure |
1 | ESM_COUNT | USINT | Number of ESMs (one ESM per processor core). |
1 | ESM_INFOS | ESM_INFO_ARRAY | 1 |
1 | 1 | [1] ... [2] | ESM_INFO | Information about the ESM [1 ... 2] 2. |
1 | 1 | 1 | TASK_COUNT | UINT | Number of tasks that were configured for the ESM. |
1 | 1 | 1 | TICK_COUNT | UDINT | Always 0 |
1 | 1 | 1 | TASK_INTERVAL | UDINT | Always 0 |
1 | 1 | 1 | TASK_INFOS | TASK_INFO_ARRAY | 1 |
1 | 1 | 1 | 1 | [1] ... [16] | TASK_INFO | Information about the tasks [1 ... 16]. |
1 | 1 | 1 | 1 | 1 | INTERVAL 1 | LINT | Time interval
- With cyclic tasks: Time interval in μs
- With acyclic tasks: 0
|
1 | 1 | 1 | 1 | 1 | PRIORITY 1 | INT | Priority of the task. |
1 | 1 | 1 | 1 | 1 | WATCHDOG 1 | LINT | Watchdog time in μs (0 = no watchdog).Watchdog time you define for the sum of the execution time and
the delay time.If the watchdog time is exceeded, the watchdog is triggered. |
1 | 1 | 1 | 1 | 1 | LAST_EXEC_DURATION | LINT | Execution time of the task in the previous cycle in μs.This also includes interruptions due to higher-priority tasks. |
1 | 1 | 1 | 1 | 1 | MIN_EXEC_DURATION | LINT | Minimum execution time of the task in μs.This also includes interruptions due to higher-priority tasks. |
1 | 1 | 1 | 1 | 1 | MAX_EXEC_DURATION | LINT | Maximum execution time of the task in μs.This also includes interruptions due to higher-priority tasks. |
1 | 1 | 1 | 1 | 1 | LAST_ACTIVATION_DELAY | LINT | Delay time of the task in the previous cycle in μs.A delay occurs when higher priority tasks are pending at the
time of task activation. |
1 | 1 | 1 | 1 | 1 | MIN_ACTIVATION_DELAY | LINT | Minimum delay time of the task in μs.A delay occurs when higher priority tasks are pending at the
time of task activation. |
1 | 1 | 1 | 1 | 1 | MAX_ACTIVATION_DELAY | LINT | Maximum delay time of the task in μs.A delay occurs when higher priority tasks are pending at the
time of task activation. |
1 | 1 | 1 | 1 | 1 | EXEC_TIME_THRESHOLD
1 | LINT | Threshold that you can define for the sum of the execution
time and the delay time. |
1 | 1 | 1 | 1 | 1 | EXEC_TIME_THRESHOLD
_CNT | ULINT | If the defined threshold EXEC_TIME_THRESHOLD is
exceeded, the value of the variable
EXEC_TIME_THRESHOLD_CNT is incremented. |
1 | 1 | 1 | 1 | 1 | NAME 1 | STRING | Name of the task. |
1 | EXCEPTION_COUNT | USINT | Number of exceptions. |
1 | EXCEPTION_INFOS | ESM_EXCEPTION_INFO_ARRAY | 1 |
1 | 1 | [1] ... [2] | ESM_EXCEPTION_INFO | Information on the exceptions [1 ... 2] 2. |
1 | 1 | 1 | TYPE_ID | UDINT | ID of the exception. |
1 | 1 | 1 | SUB_TYPE | STRING512 | Exception type |
1 | 1 | 1 | SUB_TYPE_ID | UDINT | ID of the task in which the exception occurred. |
1 | 1 | 1 | TASK_NAME | STRING | Name of the task in which the exception occurred. |
1 | 1 | 1 | PROGRAM_NAME | STRING512 | Name of the program instance in which the exception
occurred. |
1 | 1 | 1 | INFORMATION | STRING512 | Information about the exception that occurred. |
RTC (system time)
- The system variable RTC is a system variable organized as a data structure.
- You can use the RTC system variable to retrieve information about the system time of
the device-internal real-time clock.
Click here for a description of the variable
System variable | Type | Description |
RTC | RTC_TYPE | Data structure |
1 | HOURS | USINT | System time (hours) |
1 | MINUTES | USINT | System time (minutes) |
1 | SECONDS | USINT | System time (seconds) |
1 | DAY | USINT | System time (day) |
1 | MONTH | USINT | System time (month) |
1 | YEAR | UINT | System time (year) |
USER_PARTITION (partition)
- The system variable USER_PARTITION is a system variable organized as a data structure.
- You can use the USER_PARTITION system variable to retrieve various information
and memory statistics on the user partition (overlay file system).
- The memory is organized in blocks.
- A block has a constant, fixed size and a file always uses one or more blocks.
- A certain number of blocks are reserved in the Linux system for the root user. These
reserved blocks are only available for the root user and ensure his ability to act even
if the memory is occupied (e.g., for log outputs).
Click here for a description of the variable
System variable | Type | Description |
USER_PARTITION | PARTITION_INFO | Data structure |
1 | MEM_TOTAL | ULINT | Total memory of the partition in bytes (including reserved
blocks). |
1 | MEM_FREE | ULINT | Free, available memory in bytes (without reserved blocks). |
1 | MEM_USED | ULINT | Used memory in bytes (including reserved blocks). |
1 | MEM_HANDLING | ULINT | Used memory in % (without reserved blocks). |
System variables of the Safety PLC
Note
The system variables described in this section are only available if the controller includes a Safety PLC. |
SPNS
- This system variable is organized as a data structure of the type SPNSV2_TYPE.
- You can use the system variable to retrieve various information
about the safety-related runtime system of the Safety PLC.
Click here for a description of the variable
System variable | Type | Description |
SPNS | SPNSV2_TYPE | Data structure |
PRJ | | |
NAME | STRING | PLCnext Engineer project name. |
CRC | DWORD | Project CRC (32 bits) of the Safety PLC boot project. |
EXEC_TIME | UDINT | Runtime of the Safety PLC program cycle in µs. |
HAS_PRJ | BOOL | The safety-related application program and the program source are available in the memory of the Safety PLC. |
DIAG | | |
STATUS_REG | WORD | Diagnostic status register which contains the status information of the Safety PLC. It mirrors the state of the Safety PLC at all times including any error states that have occurred on the Safety PLC. Additional information and error parameters, in particular in the failure state (FS), are included in the relevant diagnostic parameter registers of the Safety PLC (elements SPNS.DIAG.PARAM_REG and SPNS.DIAG.PARAM_2). Details on the information in the diagnostic status register can be found in the Controller Manual. |
PARAM_REG | WORD | Diagnostic parameter register 1 of the Safety PLC (error code). |
PARAM_2_REG | WORD | Diagnostic parameter register 2 of the Safety PLC (additional error messages for service/support). |
EXT_PARAM_REG | DWORD | Extended diagnostic parameter register of the Safety PLC (additional error messages for service/support). |
CH2_PARAM_REG | WORD | Diagnostic parameter register 1 of the Safety PLC channel 2 (CH2) (error code). |
CH2_PARAM_2_REG | WORD | Diagnostic parameter register 2 of the Safety PLC channel 2 (CH2) (additional error messages for service/support). |
CH2_EXT_PARAM_REG | DWORD | Extended diagnostic parameter register of the Safety PLC channel 2 (CH2) (additional error messages for service/support). |
INFO | | |
CYCLE_TIME | UDINT | Safety PLC cycle in µs |
TEMP | | |
TEMP_CURRENT | INT | Currently measured Safety PLC temperature |
TEMP_MIN | INT | Minimum measured Safety PLC temperature since the last power-on of the device. |
TEMP_MAX | INT | Maximum measured Safety PLC temperature since the last power-on of the device. |
STATUS_REG | WORD | Safety PLC temperature status register 0x0000: The temperature of the Safety PLC is in the non-critical range <= 63 °C. 0x0080: The temperature of the Safety PLC is in the critical range, close to the tolerance threshold >= 64 °C and <= 73 °C. The Safety PLC remains in RUN state and, at the same time, issues a warning with error code 0xFA41. 0x8000: The temperature of the Safety PLC is beyond the permitted range (>= 74 °C). The Safety PLC goes into safe state and issues an error message with error code 0x924D. |
CPU | | |
LOAD_CURRENT | INT | Current Safety PLC CPU load |
LOAD_MIN | INT | Minimum measured Safety PLC CPU load since the last power-on of the device |
LOAD_MAX | INT | Maximum measured Safety PLC CPU load since the last power-on of the device |
STATUS_REG | WORD | Safety PLC CPU status register |
FW_Version | | |
VERSION_MAJOR | BYTE | Major version of the Safety PLC firmware |
VERSION_MINOR | BYTE | Minor version of the Safety PLC firmware |
VERSION_BUILD | WORD | Build number of the Safety PLC firmware |
FPGA_VERSION | | |
VERSION_MAJOR | BYTE | Major version of the Safety PLC hardware FPGA |
VERSION_MINOR | BYTE | Minor version of the Safety PLC hardware FPGA |
VERSION_BUILD | WORD | Build number of the Safety PLC hardware FPGA |
NUM_OF_ACTIVE_ARS | UINT | Number of active Profinet application relations (AR) |
FW_UPDATE_STATUS | UINT | Status of safety-related firmware update |
SOFT_RESET_REG | WORD | Software reset register of the Safety PLC |
SPLC_CONTROL_COMMAND
- The system variable SPLC_CONTROL_COMMAND is organized as a data structure of the type SPLC_CONTROL_TYPE.
- You can use the system variable to request the resetting of diagnostic values from the standard (non-safety-related) project.
Note
After performing the reset request, the Safety PLC confirms that the diagnostic values have been reset in the non-safety-related project via the system variable SPLC_CONTROL_CONFIRM (see below). |
Click here for a description of the variable
System variable | Type | Description |
SPLC_CONTROL_COMMAND | SPNS_CONTROL_TYPE | Data structure with 32 bits for enabling Safety PLC functions. |
CODE | DWORD | Bit 0: Resets the minimum and maximum safety roundtrip times (SRT_MIN, SRT_MAX).
Data direction: Standard controller > Safety PLC. |
PARAM | DWORD | Bits 1 to 31: Reserved. |
SPLC_CONTROL_CONFIRM
- The system variable SPLC_CONTROL_CONFIRM is organized as a data structure of the type SPLC_CONTROL_TYPE.
- This system variable shows in the standard (non-safety-related) project the acknowledgement from the Safety PLC that diagnostic values have been reset. This is the confirmation that the request to reset the diagnostic values via the system variable SPLC_CONTROL_COMMAND (see above) has been carried out successfully.
Click here for a description of the variable
System variable | Type | Description |
SPLC_CONTROL_CONFIRM | SPNS_CONTROL_TYPE | Data structure with 32 bits for confirming functions of the Safety PLC that have been requested via the SPLC_CONTROL_COMMAND variable. |
CODE | DWORD | Bit 0: Confirms the resetting of the minimum and maximum safety roundtrip times (SRT_MIN, SRT_MAX).
Data direction: Safety PLC > standard controller. |
PARAM | DWORD | Bits 1 to 31: Reserved. |