SYSTEMINFOTYPE

TYPE SYSTEMINFOTYPE
STRUCT
    runTimeNo           : BYTE;
    projectName         : STRING(32);
    numberOfTasks       : BYTE;
    onlineChangeCount   : UINT;
    bootDataFlags       : BYTE;
    systemStateFlags    : WORD;
END_STRUCT
END_TYPE

runTimeNo    : The number of the active runtime system (1..4).

projectName    : The name of the PLC project.

numberOfTasks : The number of tasks (max. 4) in the actual runtime system.

onlineChangeCount : The number of online changes made since the last complete download.

bootDataFlags : The status 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.

SYSTEMINFOTYPE 1:

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 Sourcecode (x = number of the run-time system)

TCPLC_R_x.wbp

RETAIN variables (x = number of the run-time system)

TCPLC_T_x.wbp

PERSISTENT variables (x = number of the run-time system)

TCPLC_R_x.wb~

Backup copy of the RETAIN variables (x = number of the run-time system)

TCPLC_T_x.wb~

Backup copy of the PERSISTENT variables (x = number of the run-time system)

If the file for the persistent and/or retain variables can not be written when shutting TwinCAT down, the standard reaction is for the backup file to be loaded. In that case bit 1 of the bootDataFlags (for the RETAIN variables) in the PLC and/or bit 5 (for the PERSISTENT variables) is set.

If the back-up file is not to be used under any conditions, a setting must be made in the NT registry. In the registry editor, under

[HKEY_LOCAL_MACHINE\SOFTWARE\Beckhoff\TwinCAT\Plc]

"ClearInvalidRetainData"=dword:00000000

"ClearInvalidPersistentData"=dword:00000000

the value of "ClearInvalidRetainData" or of "ClearInvalidPersistentData" must be set to 1. The default setting is 0. 

Requirements

Development environment

Target system type

PLC libraries to include

TwinCAT v2.7.0

PC or CX (x86)

PLCSystem.Lib

TwinCAT v2.8.0

PC or CX (x86)

TcSystem.Lib

TwinCAT v2.10.0 Build >= 1301

CX (ARM)

TcSystem.Lib