IEC call function for the SRL program

INFORMATION

The following example can be imported in the IEC Editor. In the IEC Editor, open the menu [Tools] > [Scripting] > [Scripts] > [R], and select the menu entry [Robotics_Examples.py].

The following additional steps are also required to use the example:

  1. Create an instance of the function block in the User_PRG program.

PROGRAM User_PRG

VAR

  fbCallFunction : CallFunction;

END_VAR

VAR_OUTPUT

  xInitDone : BOOL;

END_VAR

  1. Add the following code to the User_PRG.INIT action. If xInitDone has already been assigned in the action by other POUs beforehand, link the variable using AND ("MyRobot" corresponds to the name of the robot node assigned by the user in MOVISUITE®).

xInitDone := (* xInitDone AND *)

MyRobot.LinkICallF(fbCallFunction);

  1. Implement the desired function in the CallF method.

More information on the IEC call function for the SRL program can be found in chapter IEC function call for the SRL program.