Reference programming 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! 7.3.2.4 Functions In ST a function call can also appear as an operand. Example:
Result := Fct(7) + 3; 7.3.2.5 System Flags 7.3.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. 7.3.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.
Requirements 7.3.2.5.3 SYSTEMTASKINFOARR VAR_GLOBAL SystemTaskInfoArr AT%MB32832(*The real address may differ! *) : ARRAY[1..4] OF SYSTEMTASKINFOTYPE; END_VAR System flags are implicitly declared variables that are different on each specific PLC. The type SYTEMTASKINFOTYPE is declared in the system library, so this library has to be included in the library manager. The index in this array is the task-Id. You can get the task-Id when you call the functionblock GETCURTASKINDEX from your task. TX1200 217 Version: 1.3 Development environment Target system type PLC libraries to include TwinCAT v2.7.0 PC (i386) PLCSystem.Lib TwinCAT v2.8.0 PC (i386) TcSystem.Lib