Placeholder

At each location in the configuration dialog at which variables or text are entered, a placeholder can be set in place of the respective variable or text. This makes sense if the visualization object is not to be used directly in the program, but is created to be inserted in other visualization objects as an “instance”. When configuring such an Instance, the placeholders can be replaced with variable names or with text (see Configuring an inserted visualization Visualization, there you also find an example for using placeholders).

Any string enclosed in two dollar signs ($) is a valid placeholder (e.g. $variable1$, variable$x$). For each placeholder a „value group” can be defined as an input specification in the ‘Placeholder list’ dialog (called from ‘Extras’ ‘List of placeholders’). With one of these values you can replace the placeholder when configuring an instance of the visualization object. A placeholder list will be available in the instance to do this replacements.

Example of an application of the placeholder concept: \ \

Instances of a function block can easily be displayed with the help of instances of the same visualization. For example, in configuring the visualization visu, which visualizes the variables of function block, one could begin each variable entry with the placeholder $FUB$ (e.g. $FUB$.a). If an instance of visu is then used (by inserting visu in another visualization or by calling via ‘Zoom to vis.’), then in the configuration of this instance the placeholder $FUB$ can then be replaced with the name of the function block instance to be visualized. This might look like shown in the following: In the project define a function block containing the following declarations:

FUNCTION_BLOCK fu

VAR_INPUT

changecol : BOOL; (\* should cause a color change in the visualization \*)

END_VAR

In PLC_PRG define two instances of ‘fu’:

inst1_fu : fu;

inst2_fu : fu;

Create a visualization object ‘visu’. Insert an element and open the configuration dialog, category ‘Variables’. Enter in field ‘Change color’ the following: “$FUB$.changecol”. Open category ‘Input’ and enter in field ‘Tap Variable’ “$FUB$.changecol”. Open category ‘Text’ and enter”$FUB$ - change color “.

Create another visualization object ‘visu1’.

Insert visualization ‘visu’ twice in ‘visu1’ (two references of ‘visu’).

Mark the first reference of ‘visu’ and open the configuration dialog of category ‘Visualization’. Press button ‘Placeholder’, so that the placeholder list will be displayed. There replace entry ‘FUB’ by ‘PLC_PRG.inst_1’.

Now mark the second instance of ‘visu’ and (like described for the first one) replace ‘FUB’ by ‘PLC_PRG.inst_2’.

Now in online mode the values of the variables which are used to configure the two instances of ‘fu’ will be visualized in the corresponding instance of ‘visu’. Of course the placeholder $FUB$ can be used at all places in the configuration of ‘visu’ where variables or text strings are entered.