Handling of visualization pages

The TwinCAT PLC Control concept of visualization references and placeholders is replaced by a similar one in TwinCAT 3.

Reference to another visualization

It is possible to add a visualization page in another page and to reference it in this way. A frame element should be used for this purpose. In this way a visualization page can be assembled from various other pages. A frame element can contain one or several references to visualization pages. These visualization pages are defined in the frame selection dialog.

Interfaces for placeholders

Each visualization page can provide an interface via the interface editor, in which the input variables can be defined in a way that is comparable to a function block. These input parameters act as placeholders. In an instance (reference) of the visualization page, they have to be replaced with values or expressions for the special application in the local object.

The replacement must be carried out in the properties of the frame element, which integrates the visualization instance. Note that the input variables of a visualization instance must be assigned valid variables. If variables are changed in the interface editor, the dialog "Updating the frame parameters" is opened for the placeholders of each instance. Here you can add or edit placeholders.

Switching between visualization pages within a frame

If a frame element contains several visualization references, user inputs for another visualization element can be configured such that they cause a switch of the display of these references in the frame. The input configuration offers the action "Switch frame visualization" for this purpose. In this way it is possible to switch between several other visualization pages on a basic visualization page.

Example

A visualization page "V_MainView" has a selection menu, consisting of three buttons and a frame element. A visualization page is assigned to each button. The page is displayed in the frame element in online mode when the button is pressed.

  1. Creating a selection menu with three buttons
  2. Inserting a frame element
  3. This frame is assigned three visualizations via the frame selection dialog, between which the display is to switch.
  4. For each button an "OnMouseClick" action of type "Switch frame visualization" is added for the corresponding visualization page via the input configuration.
Handling of visualization pages 1:

Switching between visualization pages

In addition to the switching option within a frame element, the whole currently visible visualization page can be changed. To this end, the input configuration offers a further action with the name "Change shown Visualization".

Example

Two visualization pages are created with the names "V_Visu1" and "V_Visu2". Each page contains a button for switching to the respective other visualization page.

  1. Create two visualization objects with the names "V_Visu1" and "V_Visu2" in a PLC project.
  2. Add labels on both visualization pages, so that they can be distinguished from each other.
    • "V_Visu1": Enter the text “Visu 1” in the label properties.
    • "V_Visu2": Enter the text “Visu 2” in the label properties.
  3. Add a rectangle element on both sides.
    • "V_Visu1": Enter the text “Visu 2” in the rectangle properties.
    • "V_Visu2": Enter the text “Visu 1” in the rectangle properties.
  4. For both rectangles configure a "OnMouseClick" event with the action "Change shown Visualization".
    • "V_Visu1": Assign the visualization ‘V_Visu2’ to the action.
    • "V_Visu2": Assign the visualization ‘V_Visu1’ to the action.
Handling of visualization pages 2:

CurrentVisu Variable

A page changeover is also possible via the variable CurrentVisu. Following the assignment of a visualization page, all active clients on this page are refreshed automatically.

Assigning a variable:

VisuElems.CurrentVisu := sVisuName;

Assigning a text:

VisuElems.CurrentVisu := ‚Visualization‘;