EtherCAT State Machine

The EL6751 can be configured in several ways:

1. Configuration of the EL6751 with StartUp SDOs: Here, the StartUp SDOs are calculated in the EtherCAT configurator and transferred to the EtherCAT master, in the same way as is carried out, for example, in the TwinCAT System Manager.

2. Configuration of the EL6751 by scanning the CAN bus: Here, the EL6751 is ordered to scan the CAN bus and to save the CANopen configuration found there in the InfoData objects.

3. Configuration of the EL6751 with Backup Parameter Storage: Here, the configuration of the CANopen slave is stored in the flash memory of the EL6751 and need only be transmitted once.

Configuration of the EL6751 with StartUp SDOs

The following flow chart shows the sequence of the configuration of the EL6751 with StartUp SDOs:

EtherCAT State Machine 1:
Flow chart for the EL6751 with Start SDOs

After a power-on, the EL6751 is in the INIT state and has no CANopen configuration. The CAN controller is in the OFFLINE state.

CAN bus parameters

The CANopen configuration is carried out via SDO download in the PREOP state. The objects to be loaded must be transmitted either with Complete Access or with consistency nesting (first set SubIndex 0 to 0, then write SubIndex 1-n, then set SubIndex 0 to n). Care should thereby be taken to always start with object 0xF800. After receiving the object 0xF800, the EL6751 switches the CAN controller with the appropriate baud rate from 0xF800:02 to ONLINE.

CANopen slave configuration

After object 0xF800, the objects 0x8yy0, 0x8yy6 (if the CANopen slave has CAN TxPDOs), 0x8yy8 (if the CANopen slave has CAN RxPDOs) and 0x8yy3 (if application-specific StartUp-SDOs are to be sent to the CANopen slave before the sending of the CAN Start Node command) must be transmitted in this order for each CANopen slave to be configured. yy is to be incremented (starting from 0) for each CANopen slave to be configured.

PDO Mapping

For each configured CANopen slave, there is an EtherCAT RxPDO (if the CANopen slave has CAN RxPDOs) and an EtherCAT TxPDO (if the CANopen slave has CAN TxPDOs). The PDO mapping of the EtherCAT PDOs is automatically calculated by the EL6751 after the download of the respective 0x8yyz objects and can be read. The PDO mapping objects 0x16yy and 0x1Ayy thereby belong to the configuration objects 0x8yyz. The PDO mapping objects can only be written with the values that the EL6751 has calculated itself. The writing of the PDO mapping thus serves only to check the PDO mapping calculated by the EtherCAT configurator and can therefore be omitted.

PDO Assign

In addition, there are a few other EtherCAT PDOs that contain control, status and diagnostic information. These PDOs are selected via the PDO Assign. It should thereby be ensured that all EtherCAT PDOs that are assigned to the configured CANopen slaves (PDO number <= 128) always appear in the PDO Assign. With regard to the order of the PDOs in the PDO Assign, it is important to ensure that the index of the assigned EtherCAT PDO increases with each entry in the corresponding PDO Assign object. If the EtherCAT master does not transmit any PDO Assign in the StartUp SDOs, then PDOs 0x1A83 and 0x1A85 are assigned for status and diagnosis.

Cyclic CANopen communication

During the transition to SAFEOP, the EL6751 checks the length configured in the Sync Manager channels 2 and 3 against the length calculated from PDO Mapping and PDO Assign. The SAFEOP state is only adopted if these lengths match. In the SAFEOP state, the EL6751 starts the boot-up of the configured CANopen slaves. After the transmission of all CAN StartUp SDOs, the respective CANopen slave is started with the ‘Start Node’ message and the CAN PDO communication is active. All outputs in the CAN RxPDOs are thereby set to 0. As soon as the EL6751 has been switched to OP, the data from the EtherCAT outputs are also adopted into the CAN RxPDOs.

Configuration of the EL6751 by scanning the CAN bus

The following flow chart shows the sequence of the configuration of the EL6751 by scanning the CAN bus:

EtherCAT State Machine 2:
Flow chart for EL6751 with scanning of the CAN bus

After a power-on, the EL6751 is in the INIT state and has no CANopen configuration. The CAN controller is in the OFFLINE state.

Scanning the CAN bus

The scanning of the CAN bus can be started in the PREOP state, provided that no CANopen configuration has been loaded yet. To this end, the desired baud rate must be written to entry 0xF002:01 (SDO download). The EL6751 switches the CAN controller with the appropriate baud rate to ONLINE and scans the CAN bus. By cyclically reading (SDO upload) the entries 0xF002:02 or 0xF002:03, the EtherCAT master can determine the progress of the scanning of the CAN bus.

Reading the CANopen slave configuration

After completion of the scan, the InfoData objects 0x9yy0, 0x9yy8 and 0x9yyA contain the CANopen slave configuration found. The number of CANopen slaves found can be read via entry 0xF002:03 or object 0xF040. The EtherCAT master can now read the InfoData objects 0x9yyz, generate the StartUp objects 0x8yyz from them and proceed according to the Configuration of the EL6751 with StartUp SDOs.

Creating the Backup Parameter Storage

As an alternative to reading the InfoData, the Backup Parameter Storage can also be created by writing the value 0x65766173 to entry 0x1010:01. Subsequently, the EL6751 must be switched to INIT and with configuration

Configuration of the EL6751 with Backup Parameter Storage

The following flow chart shows the sequence of the configuration of the EL6751 with Backup Parameter Storage:

EtherCAT State Machine 3:
Flow chart for EL6751 with Backup Parameter Storage

After a power-on, the EL6751 is in the INIT state and has no CANopen configuration. The CAN controller is in the OFFLINE state.

CAN Bus parameter / CANopen slave configuration

The configuration stored in the Backup Parameter Storage object 0x10F2 is loaded during the transition from INIT to PREOP. Since the StartUp SDOs from the Configuration of the EL6751 with StartUp SDOs are stored in the Backup Parameter Storage object, the sequence is the same as the one described there. Hence, the stored data are first written to object 0xF800 and then the EL6751 switches the CAN controller with the appropriate baud rate from 0xF800:02 to ONLINE. Subsequently, the CANopen slaves are generated according to the stored CANopen slave configuration. If the PREOP state is acknowledged, the current CANopen configuration in objects 0xF800, 0x8yy0, 0x8yy6, 0x8yy8 and 0x8yy3 can be read.

PDO Mapping / PDO Assign

In addition, the EtherCAT master can also read the PDO Mapping and PDO Assign in the PREOP state in order to determine the lengths of the EtherCAT process data.

Creating the Backup Parameter Storage

The Backup Parameter Storage can be created as follows:

1. Download the object 0x10F2 (in PREOP, SAFEOP or OP): in this case, the data received are stored as Backup Parameter Storage in the flash memory

2. Scan the CAN bus and then write the value 0x65766173 to entry 0x1010:01: here, the EL6751 automatically generates the Backup Parameter Storage from the InfoData 0x9yy0, 0x9yy8 and 0x9yyA and stores it in the flash memory.

In both cases the EL6751 is automatically rebooted after 5 s (reverts to INIT with the AL status code 0x60). Furthermore, all SDO downloads of the objects 0xF800 or 0x8yyz are rejected.

Deleting the Backup Parameter Storage

In order to load a new Backup Parameter Storage or to simply delete the existing one, the value 0x64616F6C has to be written to entry 0x1011:01.