Sudden switch of the tool transformation
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 sudden switch of the tool transformation is done by overwriting the Interface_MyRobot.Config.Transformations.alrTool and MyRobot.fbMotionControl.alrTransformTool_Cyclic properties with the required new transformation. Overwriting alrTool makes the transformation permanently effective. Overwriting alrTransformTool_Cyclic guarantees that the transformation will be effective in the following cycle when the next motion command is interpreted.
After overwriting, it is mandatory for a PTP command to be executed directly. For this purpose, it must be ensured that the SRL interpreter has interpreted all previous motion commands at that time. The robot must also be in idle state. To guarantee these requirements, the switch takes place using an IEC CallFunction called by the CALLF SRL command.
The corresponding SRL example program must be executed to use the switch.
After importing the IEC code sample, the CallFunction block must be declared in the USER_PRG as follows
fbCallFunction : CallFunction_SwitchToolTransformation;
and linked.
USER_PRG.Init()
xInitDone :=
(* xInitDone AND *) MyRobot.LinkICallF(fbCallFunction)
Due to possible address shifts during an online change, the references of the robot instance in USER_PRG.Main() should be transferred cyclically as shown below.
fbCallFunction(
rInterface_Robot := Interface_MyRobot,
rRobot:= MyRobot);
In the following SRL example program, various tool transformations are activated one after another. At the end, the tool transformation is deactivated by activating the transformation (0..0).

In the following SRL example program, tool transformation 1 is selected to simulate convex machining with a radial tool along a continuous motion path. It shows how the tool transformation can be used in combination with the tangential control for a simple tool radius correction.

