Sample05: C++ CoE access via ADS
This article describes how to implement a TC3 C++ modules which can access the CoE (CANopen over EtherCAT) register of a EtherCAT terminal.
Download
Here you can access the source code for this sample.
- 1. Unpack the downloaded ZIP file.
- 2. Open the zip file that it contains in TwinCAT 3 by clicking on Open Project ….
- 3. Select your target system.
- 4. Build the sample on your local machine (e.g. Build->Build Solution).
- 5. Note the actions listed on this page under Configuration.
- 6. Activate the configuration by clicking on .
- The sample is ready for operation.
Description
This sample describes access to an EtherCAT Terminal, which reads the manufacturer ID and specifies the baud rate for serial communication.
This sample describes the quick start for the purpose of creating a C++ module that increments a counter on each cycle and assigns the counter to the logical output Value in the data area.
Configuration
- 1. Activate the EtherCAT address of the terminal concerned and assign it.
- 2. Activate inclusion of the ADS address in the advanced settings for the EtherCAT Terminal:
- 3. Assign the ADS address (including netId and port) to the module input AdsAdress:
- 4. The module parameters are read out and displayed by the sample code during the course of the initialization: