Using AdditionalTransformationTCP

Creating an Additional TCP Transformation

Step

Action

1

In the Devices tree or the POUs tree, select Add Object > POU... from the contextual menu.

Result: The Add POU dialog is displayed.

2

Enter a Name for your function block

3

Select Function Block.

4

Activate the Extends check box.

5

Click the browse button (...) next to the input field to open the Input Assistant.

6

Select Categories > Functionblocks > ROB > Robotic > Configuration > FB_AdditionalTransformationTCP.

7

Confirm with OK.

Result: The Add POU dialog is displayed.

8

Activate the Implements check box.

9

Click the browse button (...) next to the input field to open the Input Assistant.

10

Select Categories > Interfaces > ROB > Robotic > Configuration > IF_AdditionalTransformationTCP.

11

Confirm with OK.

Result: The Add POU dialog is displayed.

12

Click Add.

13

In case your function block was created with a method Change attached, delete the method.

14

Add further code to the function block.

Implementing a Tool Change

The following sections provide example code for a tool change. You can adopt names and types of the variables to your needs.

Implementing a Tool Change in the Transformation Function Block

Step

Action

1

Add a function block for the additional TCP transformation to your project.

2

Add two variables to the function block:

udiToolSelected : UDINT := 1;

udiToolActive : UDINT := 1;

3

Add a Property (udiTool) to the function block:

4

Implement the method Set:

THIS^.udiToolSelected := udiTool;

5

Implement the method Get:

udiTool := THIS^.udiToolActive;

6

Implement the method Direct:

7

Implement the method Inverse:
NOTE: The tool change is implemented in Direct and Inverse in the same way. If a tool change is requested, only one of the two methods is called with i_xChange = TRUE. So this call has to switch the tool for both methods.

Implementing a Tool Change in the Motion Program

Step

Action

1

State n, switch tool to 1:

2

State n+1, verify that tool was switched to 1:

Implementing an Interface to Control a Tool Change in the Motion Program

Step

Action

1

In the Devices tree or the POUs tree, select Add Object > Interface...   from the contextual menu.

Result: The Add Interface dialog box is displayed.

2

Enter a IF_AdditionalTransformationTCP as name for your interface.

3

Copy and paste the property udiTool from the previously created FB_AdditionaltransformationTCP to the new interface.

4

Click Add.

5

In the Devices tree or the POUs tree, right-click on the new interface and select Add Object > Interface method... from the contextual menu.

Result: The Add Interface method dialog box is displayed.

6

Enter  Change as name for the method.

7

Click Add.

8

Double click on the METHOD Change of the interface and add the following output variables:

9

Add the new interface to the Implements of FB_AdditionalTransformationTCP.

10

Declare an input of type IF_AdditionalTransformationTCP in SR_RobotMotion.

11

Declare an instance of the function block in SR_RobotModule.

12

Open Logic_Action of SR_RobotModule and add the new input with the previously declared instance of FB_AdditionalTransformationTCP to the call of SR_RobotMotion.

13

This interface can now be used to control a tool change in SR_RobotMotion.