The command `ethercat slaves` returns that the etherCAT devices are in PREOP, how do I switch them to OP?

What is the problem?

In case you have problems, that you cannot control your etherCAT devices. You can check the state of operation of your etherCAT device. This can be done after you SSH to the controller and use the command:

ethercat slaves

This returns a list of connected etherCAT devices, information regarding: position, mode of operation and name is given:

All etherCAT devices are in PREOP:

0  0:0  PREOP  +  EK1914, 2 Ch. Safety Input/Output 24V,  TwinSAFE
1  0:1  PREOP  +  EL6910, TwinSAFE PLC
2  0:2  PREOP  +  EK1110 EtherCAT-Verl�ngerung
3  0:3  PREOP  +  SOMANET CiA402 Drive
4  0:4  PREOP  +  SOMANET CiA402 Drive
5  0:5  PREOP  +  SOMANET CiA402 Drive
6  0:6  PREOP  +  SOMANET CiA402 Drive
7  0:7  PREOP  +  SOMANET CiA402 Drive
8  0:8  PREOP  +  SOMANET CiA402 Drive

As you can see above, the etherCAT devices are in PREOP state. The reason for this can be one of the following:

  1. Your motorcortex application or your etherCAT configuration is running in Simulation Mode:

    Check your system mode with:

    less /etc/motorcortex/config/config.json
    

    The second line should return "Mode": "Production", else change the config.json or use:

    sudo nano /etc/motorcortex/config/config.json
    

    To change for example "Mode": "Simulation" to "Mode": "Production".

  2. The domain of your EtherCAT devices is simulated, checkout Domains Configuration Panel. Inside the Domain settings menu, the simulation switch should be in off position.

  3. Your motorcortex application is not running, checkout stop/start motorcortex application.

Now your etherCAT devices should be in OP-state, check with ethercat slaves.

One or more etherCAT devices are in PREOP:

In case you have a GCC it is important that the EK1914 and EL6910 are included to your EtherCAT configuration. EtherCAT configuration examples are given in the generic or robot application and can be retrieved from the store after you log in via the portal.

What if I use the robot application and configure my own EtherCAT drives. For example with: Somanet or Elmo drives and for some reason my robot is not working? Then you check ethercat slaves and note that the etherCAT drives are in PREOP

0  0:0  OP  +  EK1914, 2 Ch. Safety Input/Output 24V,  TwinSAFE
1  0:1  OP  +  EL6910, TwinSAFE PLC
2  0:2  PREOP  +  EK1110 EtherCAT-Verl�ngerung
3  0:3  PREOP  +  SOMANET CiA402 Drive
4  0:4  PREOP  +  SOMANET CiA402 Drive
5  0:5  PREOP  +  SOMANET CiA402 Drive
6  0:6  PREOP  +  SOMANET CiA402 Drive
7  0:7  PREOP  +  SOMANET CiA402 Drive
8  0:8  PREOP  +  SOMANET CiA402 Drive

The reason for this can be one of the following:

  1. You configured your ethercat drives in a domain that is simulated, checkout Domains Configuration Panel. Inside the Domain settings menu, the simulation switch should be in off position.

  2. You wrongly configured you etherCAT drives, In most case you uploaded a ESI that doesn’t match your device, ESI files can be device and firmware depended. You have to carefully check the device and firmware version with the ESI-file.

With a correctly configured ethercat configuration, if you use ethercat slave it should look similar to this:

0  0:0  OP  +  EK1914, 2 Ch. Safety Input/Output 24V,  TwinSAFE
1  0:1  OP  +  EL6910, TwinSAFE PLC
2  0:2  PREOP  +  EK1110 EtherCAT-Verl�ngerung
3  0:3  OP  +  SOMANET CiA402 Drive
4  0:4  OP  +  SOMANET CiA402 Drive
5  0:5  OP  +  SOMANET CiA402 Drive
6  0:6  OP  +  SOMANET CiA402 Drive
7  0:7  OP  +  SOMANET CiA402 Drive
8  0:8  OP  +  SOMANET CiA402 Drive