1-second UPS (persistent data)
CX51x0
70
Version: 1.9
8.5
Checking the validity of the variables
For TwinCAT 2 the implicit structure Systeminfotype.bootDataFlags can be read in order to determine the
validity of the persistent data (see:
SYSTEMINFOTYPE [
}
70]
).
For TwinCAT 3 the implicit variables PlcAppSystemInfo.BootDataLoaded and
PlcAppSystemInfo.OldBootData are available for determining the validity of the persistent data (see:
PlcAppSystemInfo [
}
72]
).
8.5.1
SYSTEMINFOTYPE
TYPE SYSTEMINFOTYPE
STRUCT
runTimeNo :BYTE;
projectName :STRING(32);
numberOfTasks :BYTE;
onlineChangeCount :UINT;
bootDataFlags :BYTE;
systemStateFlags :WORD;
END_STRUCT
END_TYPE
runTimeNo:
specifies the number of the runtime system (1..4).
projectName:
project name as STRING.
numberOfTasks:
number of tasks contained in the runtime system (max. 4).
onlineChangeCount:
number of online changes since the last complete download.
bootDataFlags:
State of the boot data (RETAIN and PERSISTENT) after loading. The upper four bits
indicate the state of the persistent data, while the lower four bits indicate the state of the retain data.
Bit number
Description
0
RETAIN variables: LOADED (without error)
1
RETAIN variables: INVALID (the back-up copy was loaded, since no valid data was present)
2
RETAIN variables: REQUESTED (RETAIN variables should be loaded, a setting in TwinCAT
System Control)
3
reserved
4
PERSISTENT variables: LOADED (without error)
5
PERSISTENT variables: INVALID (the back-up copy was loaded, since no valid data was
present)
6
reserved
7
reserved
systemStateFlags
: Reserved.
When shutting TwinCAT down the PERSISTENT and RETAIN data is written into two files on the hard disk.
The path can be specified in TwinCAT System Control by means of the TwinCAT system properties (PLC
tab). The standard setting is "<Drive>:\TwinCAT\Boot". The files all have a fixed name with fixed extensions:
File name
Description
TCPLC_P_x.wbp Boot project (x = number of the run-time system)
TCPLC_S_x.wbp Packed source code (x = number of the runtime system)
TCPLC_R_x.wbp RETAIN variables (x = number of the runtime system)
TCPLC_T_x.wbp
PERSISTENT variables (x = number of the runtime system)
TCPLC_R_x.wb~ Backup copy of the RETAIN variables (x = number of the runtime system)
TCPLC_T_x.wb~
Backup copy of the PERSISTENT variables (x = number of the runtime system)
All manuals and user guides at all-guides.com