Skip to main content

Configuring User Inputs for Visualization Elements

All base elements and some common controls have the Input configuration property. This is where you can configure a user input for an element. For this purpose, you select an input event and an input action.

Configuring User Inputs

Requirement: A project with a visualization is open.

  1. Open the visualization and add a Button element.

    The Properties view opens for the new button.

  2. Configure the Text property with Number of clicks: %i.

  3. In the application, in the PLC_PRG POU, declare a variable: iClicks : INT;.

  4. Configure the Text variable property of the button as PLC_PRG.iClicks.

    At runtime, its variable value will replace the placeholder in the Text property.

  5. In the Input configuration property, click the Configure button in the OnMouseClick line.

  6. Select the Execute ST code action from the list of possible actions and click the _visu_img_add_selected_alarm_group.png symbol.

    The action appears in the list of actions to be executed. The blank implementation of the action appears in the window area to the right of the list.

    _visu_img_input_configuration_st_editor.png
  7. Program the action in the editor at Execute ST code:

    PLC_PRG.iClicks := PLC_PRG.iClicks + 1;

  8. Click OK to exit the dialog.

    The user input is configured.

  9. Compile, download, and start the application.

    The application runs. The visualization opens. When the user clicks the button, the action is executed, the variable PLC_PRG.iClicks is incremented, and the number of clicks is printed.

    _visu_img_user_input_button.png