This TwinCAT 3 application example helps you getting started to use a Triamec drive with EtherCAT fieldbus.
Note
The example code makes use of the Beckhoff library Tc2_CncHli. Add it to the project. Example tested with TwinCAT v3.1.4024.56 and following libraries:
The following prerequisites have to be met using this example code.
- A TwinCAT 3 runtime system (3.1.4024 or newer) with an EtherCAT-Master.
- Triamec EtherCAT Lib 2.1.0 or newer installed. Available as download from triamec.com.
- Drive commissioned. Checkout the Servo Drive Setup Guide from the documents page.
- All drives must be powered and connected to the EtherCAT-Master.
Open adapter settings for the EtherCAT-Master in I/O > Devices > Device 1 (EtherCAT) > Adapter.
Press Search... fo find the adapter on your system.
Note
Make sure, that TwinCAT is in Config Mode before you search the EtherCAT Master Adapter.
Make sure to use an isolated core on the TwinCAT PC. As each PC is different, ensure to set up the SYSTEM > Real-Time > Settings accordingly.
The following global variables have been defined to control and monitor the axes.
Variable | Description |
---|---|
gEnableAxes |
variable to enable all axes |
gStatusAxesEnabled |
variable indicates that all axes enabled |
The function block extends TE_AxisBase0 available in the Triamec EtherCAT Lib by the CNC specific interfaces.
- Save and Rebuild the Solution.
- Activate the configuration and set TwinCAT to Run Mode.
- Login and Start the PLC.
- Open Triamec_GVL and enable the axes by setting gEnableAxes to TRUE, check gStatusAxesEnabled if all axes are enabled.
You should now be able to control the axes over CNC Channel GUI (Online GUI). The control buttons are in the MOTION > CNC > Axes > Channel_N > Online dialog.