With the
dialog box, you can create a program and call the robot instance and its corresponding task automatically.Adding a new
robot node with code generation:
Step |
Action |
---|---|
1 |
For (1), select . |
2 |
For (2), select .![]() |
If you select the
option, the three following elements are added to your project:After the automatic generation procedure by the system, the project can be build and downloaded to the controller.
The most efficient way to exchange data with the robot is via
.For details, refer to Data Exchange with ModuleInterface.
Regeneration Trigger
If you added / deleted variables within the
dialog box and then entered the object under , the call program (PRG) is regenerated with the modified variables.The regeneration procedure implies the following for the program
(PRG):Variable declaration is adapted because of adding / deleting variables (1).
Call of robot is adapted because of adding / deleting variables (2).
Additional user-specific variables
Define additional user-specific variables in the declaration part of the
program:Additional user-specific code
Only integrate additional user-specific code in the body of the generated program call at the following positions:
Before the generated code part (1) or
After the generated code part (2)
After code regeneration, the declaration is slightly different because there is only one section per variable type:
The section of the user-defined local variables is merged with the section of the generated local variables.
The other variable type sections (VAR_INPUT, VAR_OUTPUT, VAR_IN_OUT, …) remain unchanged.
The body part remains unchanged after code regeneration if the following considerations are observed for additional code implementation:
Do not modify the system generated declaration and implementation of the code snippets.
This is essential for program call regeneration of the generated code.
Do not modify this generated variables block.
Do not modify this generated body block (including the two comment lines).