Pragma instructions, L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 988

Advertising
background image

L-force | PLC Designer

Programming Reference

986

DMS 4.1 EN 03/2011 TD29

Besides this, in case of inheritance the following call sequence is true (whereby for the
POUs used for example in this listing the following is assumed: "SubFB EXTENDS
MainFB" and "SubSubFB EXTENDS SubFB"):
fbSubSubFb.FB_Exit(...);
fbSubFb.FB_Exit(...);
fbMainFb.FB_Exit(...);
fbMainFb.FB_Init(...);
fbSubFb.FB_Init(...);
fbSubSubFb.FB_Init(...);

for FB_reinit:
fbMainFb.FB_reinit(...);
fbSubFb.FB_reinit(...);
fbSubSubFb.FB_Init(...);

16.1.26

Pragma Instructions
A pragma instruction is used to affect the properties of one or several variables
concerning the compilation resp. precompilation process. This means that a pragma
influences the code generation. For example it might determine whether a variable
will be initialized, monitored, added to a parameter list, made invisible in the library
manager or should be added to the symbol configuration. Message outputs during the
build process can be forced and also conditional pragmas can be used, which define
how the variable should be treated depending on certain conditions. Those pragmas
also can be entered as "defines" in the compile properties of a particular object.
A pragma can be used in a separate line, or in with supplementary text in an
implementation or declaration editor line. Within the FBD/LD/IL editor use the
command 'Insert label' and replace the default text "Label:" in the arising text field by
the pragma. In case you want to set a label as well as a pragma, insert the pragma first
and the label afterwards.
The pragma instruction is enclosed in curly brackets, upper- and lower-case are
ignored:
{ <instruction text> }
The opening bracket can immediately come after a variable name. Opening and closing
bracket must be in the same line.
Depending on the type and contents of a pragma the pragma either operates on the
line in which it is located or on all subsequent lines until it is ended by an appropriate
pragma, or until the same pragma is executed with different parameters, or until the
end of the file is reached. A "file" in this context is a declaration part, implementation
part, global variable list or type declaration.
If the compiler cannot meaningfully interpret the instruction text, the entire pragma is
handled as a comment and read over. A warning will be issued in this case.

Advertising