> The xml itself seems to be good. Could you please tell us, which master > version you are using? > > What is the exact Simulink error message when trying to read the xml?
Hi Florian, I'm using the latest EtherCAT version found in etherlab.org/download section (ethercat-devel-r1284). Screenshot that shows error message in Simulink is attached as well as output of EtherCATInfo() function in Matlab. I also found some differences between actual xml file generated (that I sent in previous post) and the output of 'ethercat xml' command (attached as .txt file) in which the famous 'Invalid bit length 2' messages appear on lines 111 and 119 (this is also shown when 'ethercat xml -p0 >> FB1111_EtherCATInfo.xml' command is used). One more question: Why, for example, already included block device's xml file (such as EL1004) cannot be included in generic device block? Is there some kind of code that prevent this or is it something else (this try results in xml file being ignored by generic block)? Regards, -- Mladen Knezic Teaching Assistant Faculty of Electrical Engineering Banja Luka, Bosnia and Herzegovina Web: www.etfbl.net Phone: +387 65 804 205 Fax: +387 51 211 408
<<attachment: error_xml.png>>
>> e = EtherCATInfo('FB1111_EtherCATInfo.xml');
??? Error using ==> XML_ParsePdoEntry>getDataType at 87
Unknown data type
Error in ==> XML_ParsePdoEntry at 40
pdo_entry.DataType = getDataType(data_type, pdo_entry.BitLen);
Error in ==> XML_ParsePdo at 42
pdo.Entry(i) = XML_ParsePdoEntry(entry.item(i-1));
Error in ==> XML_ParseSlave at 62
dev.TxPdo(i) = XML_ParsePdo(TxPdo);
Error in ==> ParseXML at 47
dev = XML_ParseSlave(DeviceElem.item(i-1));
Error in ==> EtherCATInfo.EtherCATInfo at 16
ei = ParseXML(varargin{1});linux-i82w:/home/mladenk # /opt/etherlab/bin/ethercat xml
<?xml version="1.0" ?>
<EtherCATInfo>
<!-- Slave 0 -->
<Vendor>
<Id>2</Id>
</Vendor>
<Descriptions>
<Devices>
<Device>
<Type ProductCode="#x26483052"
RevisionNo="#x00010066">EL9800-SPI-PIC18</Type>
<Name><![CDATA[EL9800 (V4.20) (PIC18, SPI, ET1100)]]></Name>
<Sm Enable="1" StartAddress="4096" ControlByte="38" DefaultSize="128"
/>
<Sm Enable="1" StartAddress="5120" ControlByte="34" DefaultSize="128"
/>
<Sm Enable="1" StartAddress="6144" ControlByte="36" DefaultSize="2" />
<Sm Enable="1" StartAddress="7168" ControlByte="32" DefaultSize="6" />
<RxPdo Sm="2" Fixed="1" Mandatory="1">
<Index>#x1601</Index>
<Name>DO RxPDO-Map</Name>
<Entry>
<Index>#x7010</Index>
<SubIndex>1</SubIndex>
<BitLen>1</BitLen>
<Name>LED 1</Name>
<DataType>BOOL</DataType>
</Entry>
<Entry>
<Index>#x7010</Index>
<SubIndex>2</SubIndex>
<BitLen>1</BitLen>
<Name>LED 2</Name>
<DataType>BOOL</DataType>
</Entry>
<Entry>
<Index>#x7010</Index>
<SubIndex>3</SubIndex>
<BitLen>1</BitLen>
<Name>LED 3</Name>
<DataType>BOOL</DataType>
</Entry>
<Entry>
<Index>#x7010</Index>
<SubIndex>4</SubIndex>
<BitLen>1</BitLen>
<Name>LED 4</Name>
<DataType>BOOL</DataType>
</Entry>
<Entry>
<Index>#x0000</Index>
<BitLen>12</BitLen>
</Entry>
</RxPdo>
<TxPdo Sm="3" Fixed="1" Mandatory="1">
<Index>#x1a00</Index>
<Name>DI TxPDO-Map</Name>
<Entry>
<Index>#x6000</Index>
<SubIndex>1</SubIndex>
<BitLen>1</BitLen>
<Name>Switch 1</Name>
<DataType>BOOL</DataType>
</Entry>
<Entry>
<Index>#x6000</Index>
<SubIndex>2</SubIndex>
<BitLen>1</BitLen>
<Name>Switch 2</Name>
<DataType>BOOL</DataType>
</Entry>
<Entry>
<Index>#x6000</Index>
<SubIndex>3</SubIndex>
<BitLen>1</BitLen>
<Name>Switch 3</Name>
<DataType>BOOL</DataType>
</Entry>
<Entry>
<Index>#x6000</Index>
<SubIndex>4</SubIndex>
<BitLen>1</BitLen>
<Name>Switch 4</Name>
<DataType>BOOL</DataType>
</Entry>
<Entry>
<Index>#x0000</Index>
<BitLen>12</BitLen>
</Entry>
</TxPdo>
<TxPdo Sm="3" Fixed="1" Mandatory="1">
<Index>#x1a02</Index>
<Name>AI TxPDO-Map</Name>
<Entry>
<Index>#x6020</Index>
<SubIndex>1</SubIndex>
<BitLen>1</BitLen>
<Name>Underrange</Name>
<DataType>BOOL</DataType>
</Entry>
<Entry>
<Index>#x6020</Index>
<SubIndex>2</SubIndex>
<BitLen>1</BitLen>
<Name>Overrange</Name>
<DataType>BOOL</DataType>
</Entry>
<Entry>
<Index>#x6020</Index>
<SubIndex>3</SubIndex>
<BitLen>2</BitLen>
<Name>Limit 1</Name>
<DataType>Invalid bit length 2
</DataType>
</Entry>
<Entry>
<Index>#x6020</Index>
<SubIndex>5</SubIndex>
<BitLen>2</BitLen>
<Name>Limit 2</Name>
<DataType>Invalid bit length 2
</DataType>
</Entry>
<Entry>
<Index>#x0000</Index>
<BitLen>8</BitLen>
</Entry>
<Entry>
<Index>#x1802</Index>
<SubIndex>7</SubIndex>
<BitLen>1</BitLen>
<Name></Name>
<DataType>BOOL</DataType>
</Entry>
<Entry>
<Index>#x1802</Index>
<SubIndex>9</SubIndex>
<BitLen>1</BitLen>
<Name></Name>
<DataType>BOOL</DataType>
</Entry>
<Entry>
<Index>#x6020</Index>
<SubIndex>17</SubIndex>
<BitLen>16</BitLen>
<Name>Analog input</Name>
<DataType>UINT16</DataType>
</Entry>
</TxPdo>
</Device>
</Devices>
</Descriptions>
</EtherCATInfo>
linux-i82w:/home/mladenk #
_______________________________________________ etherlab-users mailing list [email protected] http://lists.etherlab.org/mailman/listinfo/etherlab-users
