PLC

Keywords

Keywords that identify variable types, data types or operators must be written in capitals in all editors.

Keywords cannot be used as variable names.

Examples:

ABS, ACOS, ADD, ADR, AND, ANDN, ARRAY, ASIN, AT, ATAN

BITADR, BOOL, BY, BYTE

CAL, CALC, CALCN, CASE, CONSTANT, COS

DATE, DINT, DIV, DO, DT, DWORD

ELSE, ELSIF, END_CASE, END_FOR, END_IF, END_REPEAT, END_STRUCT, END_TYPE, END_VAR, END_WHILE, EQ, EXIT, EXP, EXPT

FALSE, FOR, FUNCTION, FUNCTION_BLOCK

GE, GT

IF, INDEXOF, INT

JMP, JMPC, JMPCN

LD, LDN, LE, LINT, LN, LOG, LREAL, LT, LTIME, LWORD

MAX, METHOD, MIN, MOD, MOVE, MUL, MUX

NE, NOT

OF, OR, ORN

PARAMS, PERSISTENT, POINTER, PROGRAM

R, READ_ONLY, READ_WRITE, REAL, REFERENCE, REPEAT, RET, RETAIN, RETC, RETCN, RETURN, ROL, ROR

S, SEL, SHL, SHR, SIN, SINT, SIZEOF, SUPER, SQRT, ST, STN, STRING, STRUCT, SUPER, SUB

TAN, THEN, THIS, TIME, TO, TOD, TRUE, TRUNC, TYPE

UDINT, UINT, ULINT, UNTIL, USINT

VAR, VAR_CONFIG, VAR_EXTERNAL, VAR_GLOBAL, VAR_IN_OUT, VAR_INPUT, VAR_OUTPUT, VAR_STAT, VAR_TEMP

WHILE, WORD, WSTRING

XOR, XORN

TwinCAT automatically checks the correct use of keywords and identifies errors with a red squiggly line immediately when they are entered.

 
When TwinCAT creates implicit code, variables and functions are usually given a name that contains "_". The use of double underscores in the implementation code is automatically prevented. Thus, there can be no conflicts between the system internal and the identifiers assigned by the programmer.

The following keywords are used in the TwinCAT export format. Therefore, you must not use them as identifiers:

ACTION
END_ACTION
END_FUNCTION
END_FUNCTION_BLOCK
END_PROGRAM