ActionPermalink

Actions can be defined and assigned to function blocks and programs. The action represents a further implementation which can be entirely created in another language as the "normal" implementation. Each action is given a name.

⮫ “Function block”

⮫ “Program”

⮫ “'Project' 'Add action'”

An action works with the data from the function block or programme which it belongs to. The action uses the same input/output variables and local variables as the "normal" implementation uses.

Example

aktion_in_fb (AC500-S PT)

Calling up the function block Counter increases or decreases the output variable "out", depending on the value of the input variable "in". Calling up the action Reset of the function block sets the output variable to zero. The same variable "out" is written in both cases.

Calling an action:

An action is called up with <Program_name>.<Action_name> or <Instance_name>.<Action_name>. Regard the notation in FBD (see example below) ! If it is required to call up the action within its own block, one just uses the name of the action in the text editors and in the graphic form the function block call up without instance information.

⮫ “Function block instances”

Examples for calls of action from another POU

Declaration for all examples:

PROGRAM PLC_PRG
  VAR
   Inst : Counter;
  END_VAR

Call of action 'Reset' in another POU, which is programmed in ST:

Inst.Reset(In := FALSE);
  Erg := Inst.out;

Call of action 'Reset' in another POU, which is programmed in FBD:

aktionsaufruf_in_fup