MAIN() main program
The MAIN program is based on the example of Frame_PlcopenP1.pro.
Since function blocks according to PLCopen specification Part 4 are also instances in this application, the platform module must be instanced and calculated for Part 4 function blocks. It is an MCV_P4_Platform type, contains the identifier P4_Platform and is invoked for Part 1 function blocks immediately after the platform function block.
The FB instances TechFctChIn and TechFctAxIn are used to notify technology information to the PLC via M, H, S or T commands from the NC program, to take this information from the HLI interface between the motion kernel and the PLC and to supply it in the PLC. The corresponding function blocks TechFctChOut and TechFctAxOut at the end of the MAIN program automatically acknowledge all technology functions which were not handled by the PLC project. To handle a technology function, an FB specified for the technology function type is instanced in the PLC project and supplied with the identification number of the technology function. This option is not highlighted in this example project. Instead only all incoming technology functions should be acknowledged so that an NC program can be executed without interruption.
After reading the technology functions, the programs are invoked successively. Ultimately they contain function blocks which enable the execution of motion tasks of individual axes or axis groups.