Operator Action Editor

Help Contents

Introduction

An Operator Action is one or more IEC 61161-3 Structured Text (ST) Statements that are run when an operator interacts with an item.

The IEC 61161-3 Statements could be a request to open a new graphic page, for example:

OpenGraphic("Folder.TagName");

The IEC 61161-3 Statements could be a request to write a new value to a tag:

TagWriteValue("Folder.TagName", NewValue );

See Operator Action Functions for the list of functions available for operator actions.

Local Variables

You can declare local variables in operator actions using Variable Declarations. Local variables are declared using the VAR and END_VAR keywords. For example:

VAR
    TagValue : LREAL;
END_VAR

Features that Use Operator Actions

These features use operator actions:

FeatureExample Property
Graphic Editor The Graphic Editor uses operator actions to define what happens when an operator does any of the following:
  • Left clicks an item.
  • Holds the left mouse button down on an item.
  • Right clicks an item.
  • Double clicks an item.
For example:
  • The ActionButtonDown property defines what happens when an operator presses the left button on an item or taps an item.
  • The ActionDoubleClick property defines what happens when an operator double clicks on an item or does a long press on an item.

See Graphic Editor Operator Actions for the list of available actions.

Toolbar Editor The Toolbar Editor uses operator actions to define what happens when a user clicks on a button in the Operator Interface Toolbar. For example:
  • The ActionButtonDown property defines what happens when an operator presses the left button on a toolbar button or taps the toolbar button.

Editing Operator Actions

To edit an operator action:

  1. Use one of these methods to select an item:
  2. In the Properties Window select a property from the Actions group, for example ActionButtonUp.
  3. Click the Browse button Property browse button to open the Operator Action Code Editor.
  4. Edit the Operator Action Code.
  5. Press OK to confirm the changes.

Note: If there are syntax errors in the Operator Action Code, the editor will not accept the changes when you press the OK button. Either correct the errors, or press the Cancel button to cancel the changes.

Autocomplete

When the Operator Action Editor is open, press Ctrl+Spacebar to open the autocomplete list to provide suggestions depending on the context:

Autocomplete menu

The autocomplete list shows:

To select an item from the autocomplete list, do one of the following:

To insert the autocomplete reference into the code, do one of the following:

Creating Common Operator Action Code

You can declare the common functions in the Global Bindings and call these from any number of Operator Actions. For example, this function declared in the Global Bindings:

FUNCTION StopPump
VAR_INPUT TagName : WSTRING; END_VAR

    TagWriteValue( PumpName, FALSE );
END_FUNCTION

can be called from an operator action using:

StopPump( "Full Tag Name of the Pump" );

Finding and Locating Errors

Syntax errors in Operator Action Code are highlighted in the editor using a dashed red underline:

Operator action showing syntax error

Note: If you move the cursor near the error, a tooltip will be displayed providing an explanation of the error.

Finding more Subtle Errors

The Operator Action Code Editor will not accept code with obvious syntax errors. It is still possible to enter code with more subtle semantic errors. To find and locate additional errors:

  1. Switch to the Code Errors tab of the Status Monitor Window:
    Status views showing code errors

    Note: The above message indicates too few parameters for the StandardTagMenu Function.

  2. Click on the link to the error. The Configuration Tool will select the item on the canvas and highlight the property with the error in the Properties Window:
    Properties window showing error

    Note: The property with the error is shown with red text.

  3. Click the Browse button Property browse button to open the global bindings text editor:
    Operator action showing semantic error

    Note: If you move the cursor near the error, a tooltip will be displayed providing an explanation of the error.

Further Information

Operator Action Functions

For the user interface functions to use in Operator Actions.

IEC 61131-3 Scripts

For information on the supported features of IEC 61131-3 Scripts.

Graphic Editor

For information on using the graphic page editor.

Toolbar Editor

For information on using the operator toolbar editor.

Properties Window

For information about editing properties of items using the Properties Window.

Glossary

For the meaning of terms used in Fernhill SCADA.