I am working on a chip which is supposed to be functional as a slave for a PLC (master) through an EtherCAT connection. The chip includes an Atmega2560 and a LAN9252, which ist he EtherCAT slave.

On first step in my project, I wrote the ESI file for LAN9252 including the inputs and outputs in the ESI. The connection is stablished and data is sent and recieved without problem from and to slave. You can see the definition part of the input and outputs in ESI code as following (I excluded the contains of every channel in outputs and inputs to make the code shorter here):

<Fmmu>Outputs</Fmmu>
<Fmmu>Inputs</Fmmu>

<Sm StartAddress="#x1000" ControlByte="#x64" Enable="1">Outputs</Sm>
<Sm StartAddress="#x1200" ControlByte="#x20" Enable="1">Inputs</Sm>
            
<!-- ***************** output PDO 12 Bytes ************* --> 
<RxPdo Fixed="1" Mandatory="1" Sm="0">
<RxPdo Fixed="1" Mandatory="1" Sm="0"> 
<RxPdo Fixed="1" Mandatory="1" Sm="0"> 
<RxPdo Fixed="1" Mandatory="1" Sm="0"> 

<!-- ***************** input PDO 20 Bytes **************** -->
<TxPdo Fixed="1" Mandatory="1" Sm="1">
<TxPdo Fixed="1" Mandatory="1" Sm="1">
<TxPdo Fixed="1" Mandatory="1" Sm="1">
<TxPdo Fixed="1" Mandatory="1" Sm="1">

<Mailbox DataLinkLayer="true">
  <CoE SdoInfo="true" PdoAssign="false" PdoConfig="false" CompleteAccess="true" SegmentedSdo="true" />
  <FoE />
</Mailbox>

<Dc>           
  <OpMode>                                          
    <Name>SM_Sync or Async</Name>
    <Desc>SM_Sync or Async</Desc>            
    <AssignActivate>#x0000</AssignActivate>
  </OpMode>
          
  <OpMode>                                            
    <Name>DC_Sync</Name>
    <Desc>DC_Sync</Desc>               
    <AssignActivate>#x300</AssignActivate>
    <CycleTimeSync0 Factor="1">0</CycleTimeSync0>
    <ShiftTimeSync0>2000200000</ShiftTimeSync0>            
  </OpMode>
</Dc>

<Eeprom>
   ByteSize>4096</ByteSize>                  
  <ConfigData>8003006EFF00FF000000</ConfigData> 
</Eeprom>

After establishing this part, in the second phase, I want to add the CoE ability to my slave, since I need to add and control a PID controler's coeffiecinets independent from my slave and through my master PLC side. By implementing the CoE definition in ESI, I face these two problems (which I'm guessing it means that CoE is not implemented).

  1. In active run the slave stays in PREOP Mode and does not go to OP Mode.
  2. In CoE-Online tab of the device, the I cannot see the variable list, which I defined already in ESI for CoE.

I bring the added and modified part of code from last step in the following:

<Profile>
  <Dictionary>              
      <DataTypes>
        <DataType>
          <Name>STRING</Name>
          <BitSize>24</BitSize>
        </DataType>
      </DataTypes>
    
      <Objects>
        <Objetc>
          <Index>#x1018</Index>
          <Name>PID Controller Coeffiecients</Name>
          <Type>STRING</Type>
          <BitSize>32</BitSize>
          <Info>
            <SubItem>
              <Name>SubIndex 000</Name>
              <Info>
                <DefaultData>04</DefaultData>
              </Info>
            </SubItem>
            <SubItem>
              <Name>Kp</Name>
              <Info>
                <DefaultData>1</DefaultData>
              </Info>
            </SubItem>
            <SubItem>
              <Name>Ki</Name>
              <Info>
                <DefaultData>1</DefaultData>
              </Info>
            </SubItem>
            <SubItem>
              <Name>Kd</Name>
              <Info>
                <DefaultData>1</DefaultData>
              </Info>
              </SubItem>
          </Info>
          <Flags>
            <Access>ro</Access>
            <Category>o</Category>
          </Flags>
        </Objetc>               
      </Objects>
    </Dictionary>
</Profile>

<Fmmu>Outputs</Fmmu>
<Fmmu>Inputs</Fmmu>
<Fmmu>MBoxState</Fmmu>
<Sm MinSize="64" MaxSize="128" DefaultSize="128" StartAddress="#x1000" ControlByte="#x26" Enable="1">MBoxOut</Sm>
<Sm MinSize="64" MaxSize="128" DefaultSize="128" StartAddress="#x1080" ControlByte="#x22" Enable="1">MBoxIn</Sm>

<Sm StartAddress="#x1100" ControlByte="#x64" Enable="1">Outputs</Sm>
<Sm StartAddress="#x1200" ControlByte="#x20" Enable="1">Inputs</Sm>

<!-- ***************** output PDO 12 Bytes ************* --> 
<RxPdo Fixed="1" Mandatory="1" Sm="2">
<RxPdo Fixed="1" Mandatory="1" Sm="2"> 
<RxPdo Fixed="1" Mandatory="1" Sm="2"> 
<RxPdo Fixed="1" Mandatory="1" Sm="2"> 

<!-- ***************** input PDO 20 Bytes **************** -->
<TxPdo Fixed="1" Mandatory="1" Sm="3">
<TxPdo Fixed="1" Mandatory="1" Sm="3">
<TxPdo Fixed="1" Mandatory="1" Sm="3">
<TxPdo Fixed="1" Mandatory="1" Sm="3">

<Mailbox DataLinkLayer="true">
  <CoE SdoInfo="true" PdoAssign="true" CompleteAccess="true" />
</Mailbox>

DC and Eeprom stay the same.

I tried to change the start address for MBox input and output and POs outputs and inputs. still the same problems exist.

I would appreciate if anyone can help me to see what is wrong in this code or show me a documentation, where I can inform myself better withe subject. I am trying to solve this issue already for a long time and no succes till now. I went through the beckhoff's documentation about EtherCAT and CoE. But unfortunatly I cannot figure out what the problem is.

Please let me know if more data on the issue is needed, and I gladly edit and add the data to the question. Thanks again.

Edit: the error shown is:

Fehler: Timeout: 'download pdo 0x1C12 index'.

Fehler: state change aborted (requested 'SAFEOP', back to 'PREOP').

0

There are 0 answers