Commissioning in TwinCAT 3
Use the following steps to configure an ELM72xx in TwinCAT 3 for operation with Drive Motion Control.
- 1. Set the operation mode "Drive Motion Control (DMC)" in CoE parameter 0x7n10:03 "Modes of operation".
- 2. Activate the Predefined PDO Assignment "Drive motion control (For TC3 DriveMotionControl Lib)".
- The process data for using Drive Motion Control is activated.
- 3. Create a PLC project if none has been created yet.
- 4. Add the "Tc3_DriveMotionControl" library to the PLC project.
(If you want to use Drive Motion Control without the "Tc3_DriveMotionControl" library, see chapter State machine.) - 5. If the “Tc3_DriveMotionControl” and “Tc2_Mc2” libraries are used simultaneously in the current project:
In the “Properties” window, set the “Qualified access only” property of one of the two libraries to “True”. - The library with “Qualified access only” can only be addressed in the PLC code via the corresponding namespace, e.g:
Tc3_DriveMotionControl.MC_Stop()
This avoids name conflicts, e.g. when calling the function blockMC_Stop
, which has the same name in both libraries. - 6. Declare a variable of type “AXIS_REF” in the PLC. Sample:
VAR
DmcAxis: AXIS_REF;
END_VAR - 7. Click on “Build” > “Build Solution” in the menu bar.
- The project is compiled.
- The process image of the PLC task is generated.
- 8. In the Solution Explorer link the PLC variables with the process data of ELM72xx.
- 9. In the PLC code, call the function block
ReadStatus()
cyclically, ideally at the beginning of each PLC cycle.
Further Information