<div dir="ltr"><div class="gmail_quote"><div dir="ltr">Hello!<div><br></div><div>I'm trying to use a EPOS3 Motor in simulink using the generic slave.</div><div>The device is correctly connected and I comunicate with it using the 'ethercat' command. I can even get the xml configuration file (see below).</div>
<div>However, I do not know how to generate the specific epos3 simulink block from the xml file.</div><div><br></div><div>At the moment I've tried to parse the xml file to matlab:</div><div>------------------------------------------------------------</div>
<div><div>>> einfo=EtherCATInfo('epos3.xml')</div><div><br></div><div>einfo = </div><div> EtherCATInfo with properties:<br></div><div> node: [1x1 org.apache.xerces.dom.DeferredElementImpl]<br></div></div>
<div><br></div><div>------------------------------------------------------------<br></div><div>The file is loaded and I've noticed that some information has been parsed (debugging the code). However, the resulting matlab structure looks like empty.</div>
<div><br></div><div>------------------------------------------------------------<br></div><div>>> slaves=einfo.getSlaves()<br></div><div><div>slaves = </div><div><br></div><div> [1x1 EtherCATInfoSlave]</div></div>
<div><br></div><div>>> s= slaves(1)</div><div> [1x1 EtherCATInfoSlave]<br></div><div><br></div><div><div>>> s.Name</div><div>Attempt to reference field of non-structure array.</div><div> </div><div>>> s.ProductNumber</div>
<div>Attempt to reference field of non-structure array.</div><div> </div><div>>> s.Name()</div><div>Attempt to reference field of non-structure array.</div></div><div>------------------------------------------------------------<br>
</div><div><br></div><div>I would like to get some information from my slave. How can I do it?<br></div><div>Perhaps the xml file is not correct?</div><div>How can I use the einfo struct to get my specific block from the generic slave block?<br>
</div><div>How do I fill the generic block parameters: SlaveConfig and PortConfig?</div><div><br></div><div>I show below the xml file:</div><div>-----------------------------------------------------------------</div><div>
<br></div><div><div><?xml version="1.0" ?></div><div><EtherCATInfo></div><div> <!-- Slave 0 --></div><div> <Vendor></div><div> <Id>251</Id></div><div> </Vendor></div>
<div> <Descriptions></div><div> <Devices></div><div> <Device></div><div> <Type ProductCode="#x64400000" RevisionNo="#x22100000">EPOS3</Type></div><div> <Name><![CDATA[EPOS3 70/10 EtherCAT (FW 2210h_6440h_0000h_0000h)]]></Name></div>
<div> <Sm Enable="1" StartAddress="#x1000" ControlByte="#x26" DefaultSize="1024" /></div><div> <Sm Enable="1" StartAddress="#x1400" ControlByte="#x22" DefaultSize="1024" /></div>
<div> <Sm Enable="1" StartAddress="#x1800" ControlByte="#x64" DefaultSize="0" /></div><div> <Sm Enable="1" StartAddress="#x1c00" ControlByte="#x20" DefaultSize="0" /></div>
<div> <RxPdo Sm="2" Fixed="1" Mandatory="1"></div><div> <Index>#x1600</Index></div><div> <Name></Name></div><div> <Entry></div>
<div> <Index>#x6040</Index></div><div> <SubIndex>0</SubIndex></div><div> <BitLen>16</BitLen></div><div> <Name></Name></div><div>
<DataType>UINT16</DataType></div>
<div> </Entry></div><div> <Entry></div><div> <Index>#x607a</Index></div><div> <SubIndex>0</SubIndex></div><div> <BitLen>32</BitLen></div>
<div> <Name></Name></div><div> <DataType>UINT32</DataType></div><div> </Entry></div><div> <Entry></div><div> <Index>#x60b0</Index></div>
<div> <SubIndex>0</SubIndex></div><div> <BitLen>32</BitLen></div><div> <Name></Name></div><div> <DataType>UINT32</DataType></div>
<div> </Entry></div><div> <Entry></div><div> <Index>#x60b1</Index></div><div> <SubIndex>0</SubIndex></div><div> <BitLen>32</BitLen></div>
<div> <Name></Name></div><div> <DataType>UINT32</DataType></div><div> </Entry></div><div> <Entry></div><div> <Index>#x60b2</Index></div>
<div> <SubIndex>0</SubIndex></div><div> <BitLen>16</BitLen></div><div> <Name></Name></div><div> <DataType>UINT16</DataType></div>
<div> </Entry></div><div> <Entry></div><div> <Index>#x6060</Index></div><div> <SubIndex>0</SubIndex></div><div> <BitLen>8</BitLen></div>
<div> <Name></Name></div><div> <DataType>UINT8</DataType></div><div> </Entry></div><div> <Entry></div><div> <Index>#x2078</Index></div>
<div> <SubIndex>1</SubIndex></div><div> <BitLen>16</BitLen></div><div> <Name></Name></div><div> <DataType>UINT16</DataType></div>
<div> </Entry></div><div> <Entry></div><div> <Index>#x60b8</Index></div><div> <SubIndex>0</SubIndex></div><div> <BitLen>16</BitLen></div>
<div> <Name></Name></div><div> <DataType>UINT16</DataType></div><div> </Entry></div><div> </RxPdo></div><div> <TxPdo Sm="3" Fixed="1" Mandatory="1"></div>
<div> <Index>#x1a00</Index></div><div> <Name></Name></div><div> <Entry></div><div> <Index>#x6041</Index></div><div> <SubIndex>0</SubIndex></div>
<div> <BitLen>16</BitLen></div><div> <Name></Name></div><div> <DataType>UINT16</DataType></div><div> </Entry></div><div> <Entry></div>
<div> <Index>#x6064</Index></div><div> <SubIndex>0</SubIndex></div><div> <BitLen>32</BitLen></div><div> <Name></Name></div><div>
<DataType>UINT32</DataType></div>
<div> </Entry></div><div> <Entry></div><div> <Index>#x606c</Index></div><div> <SubIndex>0</SubIndex></div><div> <BitLen>32</BitLen></div>
<div> <Name></Name></div><div> <DataType>UINT32</DataType></div><div> </Entry></div><div> <Entry></div><div> <Index>#x6077</Index></div>
<div> <SubIndex>0</SubIndex></div><div> <BitLen>16</BitLen></div><div> <Name></Name></div><div> <DataType>UINT16</DataType></div>
<div> </Entry></div><div> <Entry></div><div> <Index>#x6061</Index></div><div> <SubIndex>0</SubIndex></div><div> <BitLen>8</BitLen></div>
<div> <Name></Name></div><div> <DataType>UINT8</DataType></div><div> </Entry></div><div> <Entry></div><div> <Index>#x2071</Index></div>
<div> <SubIndex>1</SubIndex></div><div> <BitLen>16</BitLen></div><div> <Name></Name></div><div> <DataType>UINT16</DataType></div>
<div> </Entry></div><div> <Entry></div><div> <Index>#x60b9</Index></div><div> <SubIndex>0</SubIndex></div><div> <BitLen>16</BitLen></div>
<div> <Name></Name></div><div> <DataType>UINT16</DataType></div><div> </Entry></div><div> <Entry></div><div> <Index>#x60ba</Index></div>
<div> <SubIndex>0</SubIndex></div><div> <BitLen>32</BitLen></div><div> <Name></Name></div><div> <DataType>UINT32</DataType></div>
<div> </Entry></div><div> <Entry></div><div> <Index>#x60bb</Index></div><div> <SubIndex>0</SubIndex></div><div> <BitLen>32</BitLen></div>
<div> <Name></Name></div><div> <DataType>UINT32</DataType></div><div> </Entry></div><div> </TxPdo></div><div> </Device></div><div> </Devices></div>
<div> </Descriptions></div><div></EtherCATInfo></div></div>
</div>
</div><br><br clear="all"><div><br></div>-- <br>Pablo Iņigo Blasco.<br><a href="http://geus.wordpress.com" target="_blank">http://geus.wordpress.com</a><br><div style="display:none!important;height:auto!important;width:auto;border:1px solid rgb(0,67,179)!important;vertical-align:middle!important;padding:1px!important;margin:0px!important;color:rgb(0,0,0)!important;background-color:rgb(168,236,255)!important;font-family:Arial!important;font-size:12px!important;line-height:normal!important;font-weight:normal!important">
</div><div style="display:none!important;height:auto!important;width:auto;border:1px solid rgb(0,67,179)!important;vertical-align:middle!important;padding:1px!important;margin:0px!important;color:rgb(0,0,0)!important;background-color:rgb(168,236,255)!important;font-family:Arial!important;font-size:12px!important;line-height:normal!important;font-weight:normal!important">
</div>
</div>