Expressions > Actions

Confirms for Pulse Actions

You can add a confirm expression to an action that has a pulse qualifier. To confirm an action, the action must be defined as a Pulse qualifier (which is configured on the Action Properties dialog). Select the Confirm action for pulse qualifier check box for that action. Write the confirmation expression and assign a timeout value. When the SFC step containing this action becomes active, the action is initiated. If confirmation is enabled, the confirmation expression is run. If confirmation does not occur within the timeout value, the action fails.

For example, suppose you want to confirm that the motor is running before moving to the next action in the step. In this example, the action is to start the motor (Pulse qualifier with the action, SP:MOTOR=RUN, and a failure timeout set to 20 seconds). The Confirm expression for the Start motor step is PV:MOTOR = RUNNING with a possible confirm timeout value of 20 seconds.

If there are no pending confirms and no failed confirms, the step action or actions have completed successfully. If the expression evaluates to TRUE, the SFC will proceed to the next step.

Note

When configuring confirm and retry on an action, the confirm expression should check that either the destination parameter has changed as expected or that a related parameter changed because of the remote parameter value's change.

A confirm requires either a Timeout value or a Timeout expression. You could set the Confirm Timeout to a Time value of 5, meaning that if the motor does not start running within 5 seconds the confirm times out. A timeout value of 0 means there is no time limit on the confirm timeout.

When a step becomes active, the PENDING_CONFIRMS parameter for the step is set to equal the number of actions with confirms in the step. In our example, we have one action with one confirm. So, PENDING_CONFIRMS is set to 1. When a confirm either completes or times out, the PENDING_CONFIRMS is decreased by one. When all confirm actions within the step have either completed or timed out, PENDING_CONFIRMS is set to 0.

If a confirm condition times out (the Confirm Timeout time expires or the Confirm Timeout expression becomes TRUE before the Confirm expression becomes TRUE), the FAILED_CONFIRMS parameter is incremented by 1 and the CONFIRM_FAIL parameter is set to TRUE.

The CONFIRM_FAIL parameter is available at the action level, the step level, and in the SFC. It can be used to send an alarm so that the operator can take appropriate action.

It is left to the user to configure the transition (following the action with a confirm) to allow confirmation to occur. This can be achieved by the transition expression being:

'S2/PENDING_CONFIRMS.CV' = 0 AND 'S2/CONFIRM_FAIL.CV' = False

An action with a pulse qualifier can have a built-in delay. This is useful when one or more pulse actions in a step do not occur immediately after the step becomes active. For example, delays can be used to achieve sequencing within a step. In this case, each action in the step (except the first one) has a delay configured. The second action is delayed until the first is completed. The third is delayed until the second is completed, and so on. This technique offers several advantages. Using a single step can help simplify complex diagrams. If a sequence must occur very quickly, doing the sequence in a single step can avoid the one-scan delay required by each transition expression.

A delay uses either a delay time value or a delay expression. To add a delay time or expression, select the action on the Action Properties dialog. As a default, there is no delay time on an action with a pulse qualifier. If you want an action to be delayed until the previous action has completed, select Expression and enter a delay expression. Typically, the previous action will already have a confirm expression configured. The delay expression can check the previous action's state to see when it is complete. The previous action's state will be complete when its confirm expression evaluates to true. Then, the delay expression will evaluate to true, causing its pulse action to occur.

The delay expression checks the STATE parameter of the previous action. The path is StepName/ActionName/STATE. The following example delay expression checks to see if the value of the STATE parameter in action A1 of step S1 is complete.

'S1/A1/STATE.CV' = '$sfc_action_states:Complete'