Skip to content

alias slave number inconsistent, wrong alias number for last slave.

I came across a bug, i think.

In the source at tool/xml print section, added to print the alias along with the xml list to verify the alias nr is ok. The last slave has wrong alias number. Normally user won't see this in the xml list.

My test config is just one EK1100 with a few slaves attached.

As i am coding a autoloader, i came accross this. As the autoloader creates the reg_entry[] vector, it fails on this alias nr. I thought better give etherlab a sign.

Here is my code, it has a modified etherlab source, wich gives me a digital version of the xml : https://codeberg.org/skynet/realtime_app

I fixed it, this assumes the first slave's alias nr is valid as this is the EK1100 coupler or any other first device. This alias nr is then used al along the slavelist. This fixes the output.

However the core of the problem is not solved. Somewhere in the code there's still a incorrect output.

https://codeberg.org/skynet/realtime_app/src/commit/f8ac784d68d7ac0bd21cff05c50a921207b60440/ethercat_master/tool/CommandXml.cpp#L87

Greetings Michel.

` ?xml version="1.0" ? EtherCATInfoList EtherCATInfo !-- Slave alias 0 -- !-- Slave position 0 -- Vendor Id_2/Id_ /Vendor Descriptions Devices Device Type ProductCode="#x044c2c52" RevisionNo="#x00120000"EK1100/Type Name_![CDATA[EK1100 EtherCAT Coupler (2A E-Bus)]]/Name_ /Device /Devices /Descriptions /EtherCATInfo EtherCATInfo !-- Slave alias 0 -- !-- Slave position 1 -- Vendor Id_2/Id_ /Vendor Descriptions Devices Device Type ProductCode="#x084c3052" RevisionNo="#x00110000"EL2124/Type Name![CDATA[EL2124 4K. Dig. Ausgang 5V, 20mA]]/Name_ Sm Enable="9" StartAddress="#xf00" ControlByte="#x44" DefaultSize="0" / RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1600_/Index_ Name_Channel 1/Name_ Entry Index#x7000_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1601_/Index_ Name_Channel 2/Name_ Entry Index#x7010_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1602_/Index_ Name_Channel 3/Name_ Entry Index#x7020_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1603_/Index_ Name_Channel 4/Name_ Entry Index#x7030_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo /Device /Devices /Descriptions /EtherCATInfo EtherCATInfo !-- Slave alias 0 -- !-- Slave position 2 -- Vendor Id_2/Id_ /Vendor Descriptions Devices Device Type ProductCode="#x084c3052" RevisionNo="#x00110000"EL2124/Type Name![CDATA[EL2124 4K. Dig. Ausgang 5V, 20mA]]/Name_ Sm Enable="9" StartAddress="#xf00" ControlByte="#x44" DefaultSize="0" / RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1600_/Index_ Name_Channel 1/Name_ Entry Index#x7000_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1601_/Index_ Name_Channel 2/Name_ Entry Index#x7010_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1602_/Index_ Name_Channel 3/Name_ Entry Index#x7020_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1603_/Index_ Name_Channel 4/Name_ Entry Index#x7030_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo /Device /Devices /Descriptions /EtherCATInfo EtherCATInfo !-- Slave alias 0 -- !-- Slave position 3 -- Vendor Id_2/Id_ /Vendor Descriptions Devices Device Type ProductCode="#x084c3052" RevisionNo="#x00110000"EL2124/Type Name![CDATA[EL2124 4K. Dig. Ausgang 5V, 20mA]]/Name_ Sm Enable="9" StartAddress="#xf00" ControlByte="#x44" DefaultSize="0" / RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1600_/Index_ Name_Channel 1/Name_ Entry Index#x7000_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1601_/Index_ Name_Channel 2/Name_ Entry Index#x7010_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1602_/Index_ Name_Channel 3/Name_ Entry Index#x7020_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1603_/Index_ Name_Channel 4/Name_ Entry Index#x7030_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo /Device /Devices /Descriptions /EtherCATInfo EtherCATInfo !-- Slave alias 0 -- !-- Slave position 4 -- Vendor Id_2/Id_ /Vendor Descriptions Devices Device Type ProductCode="#x03ec3052" RevisionNo="#x00130000"EL1004/Type Name![CDATA[EL1004 4K. Dig. Eingang 24V, 3ms]]/Name_ Sm Enable="1" StartAddress="#x1000" ControlByte="#x0" DefaultSize="1" / TxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1a00_/Index_ Name_Channel 1/Name_ Entry Index#x6000_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Input/Name_ DataType_BOOL/DataType_ /Entry /TxPdo TxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1a01_/Index_ Name_Channel 2/Name_ Entry Index#x6010_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Input/Name_ DataType_BOOL/DataType_ /Entry /TxPdo TxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1a02_/Index_ Name_Channel 3/Name_ Entry Index#x6020_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Input/Name_ DataType_BOOL/DataType_ /Entry /TxPdo TxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1a03_/Index_ Name_Channel 4/Name_ Entry Index#x6030_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Input/Name_ DataType_BOOL/DataType_ /Entry /TxPdo /Device /Devices /Descriptions /EtherCATInfo EtherCATInfo !-- Slave alias 0 -- !-- Slave position 5 -- Vendor Id_2/Id_ /Vendor Descriptions Devices Device Type ProductCode="#x0aea3052" RevisionNo="#x00100000"EL2794/Type Name![CDATA[EL2794 4K. Dig. Ausgang 24V AC/DC, 2A, kurzschlussfest]]_/Name_ Sm Enable="9" StartAddress="#xf00" ControlByte="#x44" DefaultSize="0" / RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1600_/Index_ Name_Channel 1/Name_ Entry Index#x7000_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1601_/Index_ Name_Channel 2/Name_ Entry Index#x7010_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1602_/Index_ Name_Channel 3/Name_ Entry Index#x7020_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1603_/Index_ Name_Channel 4/Name_ Entry Index#x7030_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo /Device /Devices /Descriptions /EtherCATInfo EtherCATInfo

************* HERE IT IS ***********

!-- Slave alias 1 -- !-- Slave position 6 -- Vendor Id_2/Id_ /Vendor Descriptions Devices Device Type ProductCode="#x0af83052" RevisionNo="#x00120000"EL2808/Type Name_![CDATA[EL2808 8K. Dig. Ausgang 24V, 0.5A]]__/Name_ Sm Enable="9" StartAddress="#xf00" ControlByte="#x44" DefaultSize="1" / RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1600_/Index_ Name_Channel 1/Name_ Entry Index#x7000_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1601_/Index_ Name_Channel 2/Name_ Entry Index#x7010_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1602_/Index_ Name_Channel 3/Name_ Entry Index#x7020_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1603_/Index_ Name_Channel 4/Name_ Entry Index#x7030_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1604_/Index_ Name_Channel 5/Name_ Entry Index#x7040_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1605_/Index_ Name_Channel 6/Name_ Entry Index#x7050_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1606_/Index_ Name_Channel 7/Name_ Entry Index#x7060_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo RxPdo Sm="0" Fixed="1" Mandatory="1" Index#x1607_/Index_ Name_Channel 8/Name_ Entry Index#x7070_/Index_ SubIndex_1/SubIndex_ BitLen_1/BitLen_ Name_Output/Name_ DataType_BOOL/DataType_ /Entry /RxPdo /Device /Devices /Descriptions /EtherCATInfo /EtherCATInfoList `

Edited by grotius-cnc