Code example: Several conveyor belts

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].

When using several conveyor belts, the various conveyor belts must be switched using a CallFunction. To that end, the CallFunction interface must be, e.g. linked in the USER_PRG.Init() action. The use of the CallFunction function is described in chapter IEC call function for the SRL program.

The coordinate systems are changed over in the CallF method.

Like the process with only one conveyor belt, the two conveyor belts are parameterized in the PRG_ExampleMultipleConveyorTracking.Init() method.

In the PRG_ExampleSingleConveyorTracking.HighPrio() method, the position profiles of the two conveyor belts are cyclically assigned to the afbConveyor[1, 2] blocks.

The FB_ExampleMultipleConveyorTracking function block is instantiated in the declaration part of the User_PRG.

The two Init() and HighPrio() methods should be called in the USER_PRG.Init() and USER_PRG.HighPrio() actions, and the name of the robot node assigned by the user in MOVISUITE® (e.g. MyRobot) should be transferred.

User_PRG.Init()

xInitDone := (* xInitDone AND *)

fbExampleMultipleConveyorTracking.Init() AND

MyRobot.fbProgramInterpreter.LinkICallF(

fbExampleMultipleConveyorTracking);

 

User_PRG.HighPrio()

fbExampleMultipleConveyorTracking.HighPrio(

rInterface_Robot := Interface_MyRobot,

rHMI_Robot := HMI_MyRobot);

 

If additional Init() signals are depicted in the USER_PRG.Init() action (for example the Init for the CallFunction), all of them must be linked.