Using the "CallUserProgramBeforeProfileGeneration" method
The CallUserProgramBeforeProfileGeneration method is used to integrate a user program immediately before the profile of a specific axis is generated. This allows the system, for example, to calculate free profiles that are not included in the MultiMotion axis functions.
The CallUserProgramBeforeProfileGeneration method has a special role. It is an optional method and is not included in the project template.
Carry out the following steps to integrate a user program using this method:
- Create a new function block that implements the CallUserProgramBeforeProfileGeneration interface.
- Implement the code using the CallUserProgramBeforeProfileGeneration method.
- Declare an instance of the function block as a global variable, for example.
- Connect the interface of the respective axis instance with the instance of the function block by making a call from within USER_PRG.Init().
- The method of the defined function block is always called from the corresponding position Axis1.CallUserProgramBeforeProfileGeneration() during program execution. At runtime, you can switch between the methods of various function blocks.