-

Pragmas for IEC Variables

The IEC 61131-3 standard defines variable pragmas for program pre-processing and post-processing.

Note
In the current PLCnext Engineer version, pragmas can be defined only in data types worksheets, i.e., when defining user-defined data types. Variables tables do currently not provide a possibility for defining pragmas.

In the current PLCnext Engineer version, only the pragmas TrueLabel('labelString') and FalseLabel('labelString') for Boolean variables are supported.

Example: In a user-defined STRUCT data type, a TrueLabel pragma is defined for a Boolean variable Heater.

The pragma influences the online representation of the variable: If Heater = TRUE, the online value "Heating..." is displayed instead of TRUE. The following example shows the WATCHES window with the variable being TRUE and 'Display > Label' selected as display mode ‣ WATCHES: Monitoring/Debugging the Application
×‣ WATCHES: Monitoring/Debugging the Safety-Related Application
×
.

The pragma is also displayed as possible force/overwrite value:

Region/endregion pragmas in the text editor

In the text editor, you can use the {region} pragma to specify a block of code lines that can be expanded or collapsed (see the following example). The region can have a name. The {region} block must be terminated by a {endregion} pragma.

Syntax: {region 'regionname'} ... {endregion}

Supported region formats:

{ region }
{ region 'Text' }
{ region "Text" }
{ region('Text') }
{ region("Text") }

Example: