IActionController (ITF)

INTERFACE IActionController EXTENDS __SYSTEM.IQueryInterface

The behaviour of an action provider can mostly be influenced by an action controller. An action controller implements the IActionController interface and can be connected to a BehaviourModel instance via the ActionController property of the IBehaviourModel interface. If an action controller is connected to a BehaviourModel instance, the state machine will call the methods of the action controller instead of the methods of the action provider. The methods of the action controller will be called from the state machine parameterized with the related action provider method. So the action controller can encapsulate the original methods of the action controller and so create some specific modifications of their behaviour.

The exemplary implementation of the method ControlCleanupAction of an ActionController function block instance

METHOD ControlCleanupAction
VAR_INPUT
    itfCleanupActionProvider : ICleanupActionProvider;
    xAbortProposed : BOOL;
    iErrorIDProposed: INT;
END_VAR
VAR_OUTPUT
    xComplete : BOOL;
    xAbort: BOOL;
    iErrorID : INT;
END_VAR

(* Do some specific action before calling the original CleanupAction *)

itfCleanupActionProvider.CleanupAction(
    xAbortProposed:=xAbortProposed,
    iErrorIDProposed:=iErrorIDProposed,
    xComplete=>xComplete, // signal ready contition
    xAbort=>xAbort,  // signal abort condition
    iErrorID=>iErrorID // signal error condition
);

(* Do some specific action after calling the original CleanupAction *)