Drive plc developer studio – Lenze DDS v2.3 User Manual

Page 142

Advertising
background image

Drive PLC Developer Studio

Editors

7-20

l

DDS EN 2.3

7.2.19.1

Pragma instruction

The pragma instruction controls the compile process and is always written with additional
text in a program line or in a separate declaration editor line.

This instruction is given in curly brackets and is case-insensitive.
{<Instruction>}

Should the compiler be unable to interpret the instruction text, the complete pragma is
treated as a comment and ignored, while a warning is given for this process.
Ignore compiler directive <instruction text>

The pragma instruction affects the line in which it occurs or the subsequent ones until it is
revoked by another pragma instruction or the same pragma instruction is executed with
different parameters. The pragma instruction also ends at the end of an implementation, a
global variable list or a type declaration.

The opening bracket may directly follow a variable name. Brackets that belong together must
be in the same line.

Pragma instructions must be written in the following syntax:

{flag[<flags>][off

|on]}

This pragma may influence the properties of a variable declaration.
<flags>

may be a combination of the following flags.

The following pragma is currently available:

noinit

Variable is not initialized

nowatch

Vaiable not displayed (no monitor).

nowrite

Vaiable exported into the icon file without write access.

noread

Vaiable exported into the icon file without read access.

noread, nowrite

Vaiable not exported into the icon file.

Modifier on makes the pragma effective for all subsequent variable declarations until revoked by
pragma {flag off}. The pragma may also be overwritten by another {flag<flags>on} pragma.

Without modifier on or off, the pragma will affect only the current variable declaration.

Examples

Variable a is not initialized and not displayed. (Monitor)
Variable b is not initialized.

VAR

a:INT{flag noinit, nowatch};
b:INT{flag noinit};

END VAR

VAR

{flag noinit, nowatch on}
a:INT;
{flag noinit on}
b:INT;
{flag off}

END VAR

Neither variable is initialized.

{flag noinit on}
VAR

a:INT;
b:INT;

END VAR
{flag off}

VAR

{flag noinit on}
a:INT;
b:INT;
{flag off}

END VAR

The noread and nowrite flags may be used to assign restricted access rights to individual variables.
By default, the variable has the same setting as the organization unit. Should it have no read and
write access, it will not be exported into the icon file.

Show/Hide Bookmarks

Advertising