beautypg.com

Attribute qualified_only, Attribute reflection, L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 1011

background image

L-force | PLC Designer

Programming Reference

DMS 4.1 EN 03/2011 TD29

1009

Attribute Qualified_Only
After assigning the pragma {attribute 'qualified_only'} on top of a global variable list,
its variables can only be accessed by using the global variable name, e.g. gvl.g_var. This
works even for variables of enumeration type and may be useful to avoid name
mismatch with local variables.
Syntax:
{attribute 'qualified_only’}

Example:
Assume the following global variable list GVL with attribute 'qualified_only':

{attribute 'qualified_only'}
VAR_GLOBAL
iVar:INT;
END_VAR

Within a POU, e.g. program PLC_PRG, this global variable has to be called with the
prefix GVL, e.g.

GVL.iVar:=5;

The following incomplete call of the variable will cause instead an error:

iVar:=5;

Attribute Reflection
The pragma {attribute 'reflection'} is attached to signatures. Due to performance
reasons it is an obligatory attribute for POUs carrying the instance-path attribute.
Syntax:
{attribute 'reflection’}

Example:
see the example of the instance-path attribute.