Combination of electronic cam and robot functionality
The following application example shows how the cam and robot functionalities can be combined. More information can be found in the chapter Functional description.
In order to use cams for the robot paths, you must first execute an SRL motion command to the starting point of the cam in program operation. Afterwards, cyclically assign the Cartesian coordinates of the cam as a master position in the HighPriority task using the SetMasterPosition() method (see following example). The cam must begin in idle state and be constant. As soon as the cam has finished in idle state, the next SRL motion command can, e.g, be entered in the SRL program.
The SetMasterPosition() method returns TRUE if the master position has been successfully accepted. It returns FALSE if, for instance, the motion was interrupted due to an error, revocation of the enable, or if the program was paused. When starting again, the robot automatically returns to the last successfully accepted master position (BackToPath). From this point, the cam must then be applicatively approached again from idle state.
To prevent a path deviation from the entered cam during an interruption, such as when a protection door is opened, it should first be braked to idle state before the enable is revoked for the robot. Otherwise, the robot brakes axis-by-axis since it is unaware of the following section of the applicatively supplied cam.
Not only can the cam be executed in the BASE or USER coordinate system in a static environment, but also in a moving USER coordinate system. To that end, only the preceding SRL motion command must be approached in the USER coordinate system. See Synchronized movement with a conveyor belt (conveyor tracking). By doing so, goods that are moved on a conveyor belt or rotary table can be processed by a robot with the desired contour.
Since the cam is supplied applicatively, the robot cannot output the remaining distance and time until the end of the cam is reached. The corresponding output variables Interface_MyRobot.Prg.OUT.lrRemainingDistance/lrRemainingTime therefore contain the value 0.
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]. Afterwards, the program must be opened in USER_PRG.HighPrio() as follows and, during the process, the name of the robot node (e.g. MyRobot) assigned by the user in MOVISUITE® must be transferred to the example program:
PRG_ExampleMasterPositionCam(rInterface_Robot :=
Interface_MyRobot, rRobot := MyRobot);
Example SRL program to combine cam and robot functionality. xMasterPosition is suitable for the example IEC code of the SRL variable BOOLVAR[1] shown above.