Constants, Typed Literals

Constants are identified by the key word CONSTANT. They can be declared locally or globally.

Syntax:

VAR CONSTANT

<Identifier>:<Type> := <initialization>;

END_VAR

Example:

VAR CONSTANT
 c_iCon1:INT:=12; (* 1. Constant*)
END_VAR

See ‘Operands in CoDeSys’ Overview for a listing of possible constants. See there also regarding the possibility of using typed constants (Operands in CoDeSys Typed Literals).