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

Page 1010

Advertising
background image

L-force | PLC Designer

Programming Reference

1008

DMS 4.1 EN 03/2011 TD29

Attribute Parameterstringof
With the help of the pragma {attribute 'parameterstringof'} the instance name of a
variable is made accessible by the visualization.
Syntax:
{attribute 'parameterstringof’ := ' <variable>'}

Example:
In the main program e. g. the instance myDUT of the user defined data structure DUT
is defined:

PROGRAM PLC_PRG
VAR
myDUT: DUT;
END_VAR

This instance shall be passed to visualization function block "Vis" (via parameter
"instance") that is referenced by a frame of another visualization "MainVisu":

Abb. 541 Detail of properties of visualization element contained in MainVisu

In the associated interface editor of "Vis" we'll find, of course, the input/output
variable "instance", but also another input variable named "instanceStr":

Although being an input variable "instanceStr" is not listed within the inputs of the
reference (see above picture). This is, because the variable "instanceStr" carries the
attribute 'parameterstringof' and will so be assigned automatically to the name of the
variable associated to the attribute. In our example, the associated variable is instance;
therefor the string variable instanceStr will get assigned to "PLC_PRG.myDUT" and can
now be used by the visualization "Vis", e.g. as text variable defining a placeholder %s.

Advertising