Question: Fixed PDO and error "Attempt to write a read-only object"
Hi, my application failed to bring the slave into OP state due to error "Attempt to write a read-only object". I see it is most likely because my program tries to configure the fixed pdo 0x1701 using ecrt_slave_config_pdos().
I just wonder what is the right procedure to setup the fixed PDO. According to the document below, it seems we should leave empty entry configuration for the fixed PDO before calling ecrt_slave_config_pdos(). However it says it works only when the slave is online.
I would like to clarify the right procedure will be monitoring the slave state. When the slave go to the pre-op state, then call the ecrt_slave_config_pdos() with empty pdo entry configuration. Is my understanding correct here?
ecrt_slave_config_pdos() manual: https://docs.etherlab.org/ethercat/1.5/doxygen/group__ApplicationInterface.html#ga7bc2683699a5c0c551f0cfdc90c1a559
The next example shows, how to configure the PDO assignment only. The entries for each assigned PDO are taken from the PDO's default mapping. Please note, that PDO entry registration will fail, if the PDO configuration is left empty and the slave is offline.
dmesg output:
[42059.930285] EtherCAT ERROR 0-0: SDO download 0x1701:00 (1 bytes) aborted.
[42059.930290] EtherCAT ERROR 0-0: SDO abort message 0x06010002: "Attempt to write a read-only object".
[42059.930291] EtherCAT WARNING 0-0: Failed to clear PDO mapping.
[42059.930292] EtherCAT WARNING 0-0: Currently mapped PDO entries: 0x6040:00/16 0x607A:00/32 0x60B8:00/16 0x60FE:01/32. Entries to map: 0x6040:00/16 0x607A:00/32 0x60B8:00/16 0x60FE:01/32
[42059.930299] EtherCAT WARNING 0-0: Failed to configure mapping of PDO 0x1701.
The ESI definition for PDO 0X1701:
<RxPdo Fixed="1" Sm="2">
<Index>#x1701</Index>
<Name LcId="1033">258th receive PDO Mapping</Name>
<Exclude>#x1600</Exclude>
<Exclude>#x1702</Exclude>
<Exclude>#x1703</Exclude>
<Exclude>#x1704</Exclude>
<Exclude>#x1705</Exclude>
<Entry>
<Index>#x6040</Index>
<SubIndex>0</SubIndex>
<BitLen>16</BitLen>
<Name LcId="1033">Controlword</Name>
<DataType>UINT</DataType>
</Entry>
<Entry>
<Index>#x607A</Index>
<SubIndex>0</SubIndex>
<BitLen>32</BitLen>
<Name LcId="1033">Target position</Name>
<DataType>DINT</DataType>
</Entry>
<Entry>
<Index>#x60B8</Index>
<SubIndex>0</SubIndex>
<BitLen>16</BitLen>
<Name LcId="1033">Touch probe function</Name>
<DataType>UINT</DataType>
</Entry>
<Entry>
<Index>#x60FE</Index>
<SubIndex>1</SubIndex>
<BitLen>32</BitLen>
<Name LcId="1033">Physical outputs</Name>
<DataType>UDINT</DataType>
</Entry>
</RxPdo>