Creating a Program for Controlling the Axis Group
The following instructions describe how to create a program for controlling an axis group.
Requirement: A project has been created with an axis group, as specified in the section "Creating Axis Groups".
The program for controlling an axis group is created in the PLC_PRG POU with the CFC implementation language.
Open the PLC_PRG program in the editor.
Drag the Box element to the editor.
Map the MC_POWER function block to the box.
Configure the function block according to the following image.
Explanation:
The function block activates the drive.
The Status output indicates successful controller enable.
Create two more function blocks MC_Power_A2 and MC_Power_A3 for the DriveA2 and DriveA3.
Create a function block of the MC_GroupEnable type.
This function block is used for enabling the Tripod axis group.
Connect the Status outputs of the MC_POWER blocks to an AND block. Connect the output of the AND block to the Execute input of the MC_GroupEnable function block.
Explanation:
When all axis controllers are powered (Status = TRUE), the axis group will be enabled.
The Status output reports the success of the command.
Insert a MC_MoveDirectAbsolute function block for running the drive.
Connect the Done output of the MC_GroupEnable_0 block to the Execute input of the MC_MoveDirectAbsolute function block.
Extend the program as follows:
Explanation:
The MC_MoveDirectAbsolute function block commands a PTP motion of the Tripod axis group.
In the example, the kinematics are run by 600 in the z-axis. This value is mapped to the Position input via the SMC_POS_REF structure.
See also
If the program has been created completely and it can be compiled without errors, then you can download the program to the controller.
Start the CODESYS SoftMotion Win V3 runtime system (CODESYSControlService.exe in the directory "...\\GatewayPLC").
In the communication settings, set the connection path to your controller.
Click Online ‣ Login .
Download the project to the controller.
Click Debug ‣ Start .
Open the Tripod object in the editor.
⇒ The position of the axes changes.
See also