beckhoff TwinCAT 2 PLC Control — 10.6.2.5.2 SYSTEMINFO

Appendix Structure variables can be accessed using the following syntax: . Function block and program variables can be accessed using the following syntax: . 10.6.2.3 Addressing bits in variables In integer variables, individual bits can be accessed. For this, the index of the bit to be addressed is appended to the variable, separated by a dot. The bit-index can be given by any constant. Indexing is 0- based. Example: a : INT; b : BOOL; ... a.2 := b; The third bit of the variable a will be set to the value of the variable b. If the index is greater than the bit width of the variable, the following error message is issued: Index ' ' outside the valid range for variable ' '!

Bit addressing is possible with the following variable types: SINT, INT, DINT, USINT, UINT, UDINT, BYTE, WORD, DWORD. If the variable type does not allow it, the following error message is issued: „Invalid data type ' ' for direct indexing“ A bit access must not be assigned to a VAR_IN_OUT variable! 10.6.2.4 Functions In ST a function call can also appear as an operand. Example: Result := Fct(7) + 3; 10.6.2.5 System Flags 10.6.2.5.1 System flags System flags are implicitly declared variables that are different on each specific PLC. To find out which system flags are available in your system, use the command "Insert" "Operand".

An Input Assistant dialog box pops up, select the category System Variable. 10.6.2.5.2 SYSTEMINFO VAR_GLOBAL SystemInfo AT%MB32768(*The real address may differ!*) : SYSTEMINFOTYPE; END_VAR System flags are implicitly declared variables that are different on each specific PLC. The type SYSTEMINFOTYPE is declared in the system library, so this library has to be included in the library manager. TwinCAT 2 PLC Control 333 Version: 1.0