You are here: Core Reference > Coding > Logic > Add a Method Variable to a Sequential Function Chart

Add a Method Variable to a Sequential Function Chart

If your Sequential Function Chart contains actions that are to initiate ClearSCADA methods (controls such as Override, Enable Alarms etc.), you need to add method variables.

Each method variable declares a method for use in your Sequential Function Chart (SFC). The configuration of the method variable corresponds to the METHOD declaration in ST (see Executing Methods on Database Items).

To add a method variable to an SFC:

  1. Display the SFC in Design mode (see Display a Sequential Function Chart).
  2. Select the Methods tab.
  3. Right-click in the list on the Method tab to display a context sensitive menu.
  4. Select the Add option to display the Add Method Variable window.

  5. Use the Add Method Variable window to define the settings for the method declaration:
    • Name—Enter the name for the method variable. This is the name that will be used to reference the variable within the ST code.
    • Object—Use the browse button feature to select the database item that has the method that you want to use. For example, if you want to add the EnableAlarms method for a point named 'Power', use the browse button feature to select the 'Power' point.
    • Aggregate—If the item you selected in the Object field is stored in a class that has an aggregate, you can use the methods for the aggregate. To do this, select the relevant aggregate from the Aggregate combo box. If the method is not provided by an aggregate, select the (None) option.
    • Alarm—Use this combo box to select the alarm condition for the method. This is useful as it allows you to use a method that is only available for specific alarm conditions (alarm conditions are similar to aggregates in the database as they also provide additional fields and methods).
    • Method—Use the Method combo-box to select the method that you want to add to the SFC. The list contains the methods that are available for the selected database item. The Hand Control method is unavailable as it does not work in the same way as other methods. If you need to write a current value, you should use add a direct variable and write to it instead.
    • Prototype—The Prototype field is only available for methods that set a specific value, for example, methods that override an analog point so that the point has a value of 50.

      Use the Prototype field to define the type of value(s) that will be written by the method. The actual values that will be written are defined in the configuration of the actions that will be associated with the method.

      If the Prototype field is available, it will display at least one value type that is appropriate to the method. Typically, you will not need to change the value type(s). If you do decide to change them, you need to enter value types that are appropriate for the type of database item to which the value is written (see Built-In Data Types).

  6. Select the OK button to confirm your choices.

You can now include the method in the ST code for one of the actions on the SFC (see Edit an Action on a Sequential Function Chart). When you associate the action with a step, the defined method will be performed when the step takes place (see Edit an Action Association).


ClearSCADA 2015 R2