4 System variables
22
4.3 Internal variables
The internal variables can be used in the ST code to implement certain functions.
ext_error
reset_flag
sys_error
week_day
Designation Description
ext_error Integer variable
The variable indicates errors that occurred during accesses outside the ST module.
In the event of an error, the variable returns a value > 0 (no error = 0).
Designation Description
reset_flag Boolean variable
The variable is set to TRUE after power-on and is used to initialize variables. Ex-
ample: chapter 7.1 "Selection instructions", page 31
If the ST code is completely run through once without an error after power on, the
variable is set to FALSE. Otherwise, it stays as TRUE.
Debug mode: The first time the program is started in debug mode or after a program
stop, the variable is TRUE. After a second run through, it is set to FALSE.
Designation Description
sys_error Real variable
The variable returns an error value if an error occurs during program execution (no
error = 0):
1.00E+37 = general error value
1.0E+37 = underrange (underflow)
2.0E+37 = overrange (overflow)
3.0E+37 = invalid input value
4.0E+37 = division by zero
5.0E+37 = incorrect math value
7.0E+37 = invalid value (general)
Designation Description
week_day Integer variable
The variable includes the current day:
0 = Sunday, 1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday,
6 = Saturday
The day is derived from the input variable rtc.cdt.