You are here: Core Reference > Coding > Logic > Initiate a Method on a Sequential Function Chart

Initiate a Method on a Sequential Function Chart

If you want your Sequential Function Chart to contain a step that initiates a method (control for a specific item), you need to follow this procedure:

  1. Display the SFC in Design mode (see Display a Sequential Function Chart).
  2. Locate the step that you want to associate with the method. If the SFC does not contain a suitable step, create a step (see Add a Step to a Sequential Function Chart) and link it to the SFC by drawing connection lines.
  3. Add a method variable (see Add a Method Variable to a Sequential Function Chart). You will need to configure the method variable so that it is associated with the relevant database item and the required method.
  4. Add an action (see Add an Action to a Sequential Function Chart). You will need to configure the action so that it has ST code that it references the method and defines the value or state that the method will set (where appropriate).
  5. Configure an action association (see Edit an Action Association) that defines when the method will be initiated.

    You need to configure the action association so that:

    • The method configuration defines the correct method and database item that is to be initiated.
    • The step is associated with the action that initiates the method.
    • The action is associated with the correct step, and has ST code that references the method (and defines any values or states that are set by the method).
    • The action association defines the correct settings for the action.
  6. Save the SFC.

Example:

A point named 'Valve' is to have its state overridden by a condition on a Sequential Function Chart (SFC). When the OPENVALVE step of the SFC is reached, the program will cause ClearSCADA to change the 'Valve' point's state to state 1 (True).

On the SFC, a new step is created. The step is named OPENVALVE.

An action named Override is created. This is the action that will be associated with the OPENVALVE step.

A new method is created with these settings:

  • Name—ValveOverride
  • Object—.Valve
  • Method—Override
  • Prototype—USINT

The action is configured so that its ST code references the ValueOverride method and defines the state that is to be set:

ValueOverride (True);

When the OPENVALVE step takes place, the Override action is initiated.

The Override action causes the 'Valve' point to change to state 1 (True). The configuration of the 'Valve' point defines that state 1 corresponds to the valve being opened.

The action item on the SFC is connected to the OPENVALVE step.

Finally, an action association is edited so that a ValveOpen indicator variable is shown for the action, and the qualifier is set to N (the override will repeat automatically when the step is True).


ClearSCADA 2015 R2