Remanent and persistent data
There are special flags for remanent and persistent data in the higher memory region.
Remanent data
The remanent data is located in the flags area. The default setting is for 64 remanent bytes, i.e. from %MB0 to %MB63. This region can be expanded to a maximum size of 512 bytes. It should be borne in mind that the task time increases with the quantity of remanent data (approx. 0.5 ms for 512 bytes). The settings for the remanent data can be made via the (TwinCAT) System Manager, or with the KS2000 configuration software (Table 1, Register 15, default value 64 max. 512 bytes).
Persistent data
Persistent data is even more stable, and is retained even through a program download. The number of persistent data must be greater than or equal to the number of remanent data! Like the remanent data, the persistent data is located in the region allocated for flags (%MBxx). You can make the settings for the persistent data using the KS2000 configuration software (Table 1, Register 18, default value 0, max. 512 bytes).
Example
400 bytes of remanent data, of which 200 bytes are to be persistent
Register 15 400 (%MB200 - %MB399)
Register 18 200 (%MB0 - %MB199)
Cycle Time Measuring
The flags area includes a timing system with a resolution of one millisecond for each digit. The data type is UDINT (unsigned double integer). This value can be overwritten by the program, in order to align with a controller. The timer rolls over in about 48 days.
Flag byte | Meaning | |
---|---|---|
%MB504-507 | 4 byte | |
Type | UDINT | |
| 0..4.22 billion ms / 0.. about 48 days | |
Resolution | 1 ms / digit |
Diagnostics
It is possible to read the diagnostic data in the Bus Terminal controller. This information is located in the flags area.
Flag byte | Meaning | |
---|---|---|
%MB508-509 | Bit 0 | Interbus communication ("1" - no communication) |
Bit 1-15 | reserved | |
|
| |
%MB510-511 | Bit 0 | K-bus error |
Bit 1 | Configuration error | |
Bit 2-15 | reserved |