Object Action

Symbol: Object Action 1:

An action can be used to implement further program code. You can implement this program code in a language that is different from the basic implementation. The basic implementation is the function block or the program under which you have inserted the action.

An action does not have its own declarations and uses the data of the basic implementation. This means that the action uses the input/output and local variables of the basic implementation.

Creating an object Action

1. Select a function block or a program in the Solution Explorer in the PLC project tree.
2. In the context menu select the command Add > Action…
The dialog Add Action opens.
3. Enter a name and select an implementation language.
4. Click on Open.
The object is added to the PLC project tree and opens in the editor.

Dialog Add Action

Name

Name of the action

Implementation language

Check box for the implementation language

Calling an action

Syntax:

<program>.<action> or <FB-instance>.<action>

To call an action only within the basic implementation, it is sufficient to specify the action name.

Examples:

Calls a Reset action from another POU. In other words, the call is not made in the basic implementation.

Declaration:

PROGRAM MAIN
VAR
    fbCounterA : FB_Counter;
END_VAR

Calls the Reset action from an IL POU:

Object Action 2:

Calls the Reset action from an ST POU:

fbCounterA.Reset(In := FALSE);
nRes := fbCounterA.nOut;

Calls the Reset action from an FBD POU:

Object Action 3:
Object Action 4:

Actions are common in the implementation language SFC. (SFC element Action)

See also: