Step |
Action |
---|---|
1 |
In the tree or the tree, select from the contextual menu.Result: The dialog is displayed. |
2 |
Enter a for your function block |
3 |
Select . |
4 |
Activate the check box. |
5 |
Click the browse button ( ) next to the input field to open the . |
6 |
Select . |
7 |
Confirm with .Result: The dialog is displayed. |
8 |
Activate the check box. |
9 |
Click the browse button ( ) next to the input field to open the . |
10 |
Select . |
11 |
Confirm with .Result: The dialog is displayed. |
12 |
Click . |
13 |
In case your function block was created with a method
attached, delete the method.
![]() |
14 |
Add further code to the function block. |
The following sections provide example code for a tool change. You can adopt names and types of the variables to your needs.
Step |
Action |
---|---|
1 |
Add a function block for the additional TCP transformation to your project. |
2 |
Add two variables to the function block:
|
3 |
Add a udiTool) to the function block:
(![]() |
4 |
Implement the method :THIS^.udiToolSelected := udiTool; |
5 |
Implement the method :
|
6 |
Implement the method
:
![]() |
7 |
Implement the method
:
![]() |
Step |
Action |
---|---|
1 |
State n, switch tool to 1:
![]() |
2 |
State n+1, verify that tool was switched to 1:
![]() |
Step |
Action |
---|---|
1 |
In the Devices tree or the POUs tree, select 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 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 ![]() |
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. ![]() |