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

 1METHOD ControlCleanupAction
 2VAR_INPUT
 3    itfCleanupActionProvider : ICleanupActionProvider;
 4    xAbortProposed : BOOL;
 5    iErrorIDProposed: INT;
 6END_VAR
 7VAR_OUTPUT
 8    xComplete : BOOL;
 9    xAbort: BOOL;
10    iErrorID : INT;
11END_VAR
12
13(* Do some specific action before calling the original CleanupAction *)
14
15itfCleanupActionProvider.CleanupAction(
16    xAbortProposed:=xAbortProposed,
17    iErrorIDProposed:=iErrorIDProposed,
18    xComplete=>xComplete, // signal ready contition
19    xAbort=>xAbort,  // signal abort condition
20    iErrorID=>iErrorID // signal error condition
21);
22
23(* Do some specific action after calling the original CleanupAction *)

Methods:

Structure: