[etherlab-users] Fwd: Trying to use the Generic Slave for an EPOS3 Motor

Pablo Iñigo Blasco pibgeus at gmail.com
Thu Feb 20 20:20:16 CET 2014


Hello!

I'm trying to use a EPOS3 Motor in simulink using the generic slave.
The device is correctly connected and I comunicate with it using the
'ethercat' command. I can even get the xml configuration file (see below).
However, I do not know how to generate the specific epos3 simulink block
from the xml file.

At the moment I've tried to parse the xml file to matlab:
------------------------------------------------------------
>> einfo=EtherCATInfo('epos3.xml')

einfo =
  EtherCATInfo with properties:
    node: [1x1 org.apache.xerces.dom.DeferredElementImpl]

------------------------------------------------------------
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.

------------------------------------------------------------
>> slaves=einfo.getSlaves()
slaves =

    [1x1 EtherCATInfoSlave]

>> s= slaves(1)
    [1x1 EtherCATInfoSlave]

>> s.Name
Attempt to reference field of non-structure array.

>> s.ProductNumber
Attempt to reference field of non-structure array.

>> s.Name()
Attempt to reference field of non-structure array.
------------------------------------------------------------

I would like to get some information from my slave. How can I do it?
Perhaps the xml file is not correct?
How can I use the einfo struct to get my specific block from the generic
slave block?
How do I fill the generic block parameters: SlaveConfig and PortConfig?

I show below the xml file:
-----------------------------------------------------------------

<?xml version="1.0" ?>
<EtherCATInfo>
  <!-- Slave 0 -->
  <Vendor>
    <Id>251</Id>
  </Vendor>
  <Descriptions>
    <Devices>
      <Device>
        <Type ProductCode="#x64400000" RevisionNo="#x22100000">EPOS3</Type>
        <Name><![CDATA[EPOS3 70/10 EtherCAT (FW
2210h_6440h_0000h_0000h)]]></Name>
        <Sm Enable="1" StartAddress="#x1000" ControlByte="#x26"
DefaultSize="1024" />
        <Sm Enable="1" StartAddress="#x1400" ControlByte="#x22"
DefaultSize="1024" />
        <Sm Enable="1" StartAddress="#x1800" ControlByte="#x64"
DefaultSize="0" />
        <Sm Enable="1" StartAddress="#x1c00" ControlByte="#x20"
DefaultSize="0" />
        <RxPdo Sm="2" Fixed="1" Mandatory="1">
          <Index>#x1600</Index>
          <Name></Name>
          <Entry>
            <Index>#x6040</Index>
            <SubIndex>0</SubIndex>
            <BitLen>16</BitLen>
            <Name></Name>
            <DataType>UINT16</DataType>
          </Entry>
          <Entry>
            <Index>#x607a</Index>
            <SubIndex>0</SubIndex>
            <BitLen>32</BitLen>
            <Name></Name>
            <DataType>UINT32</DataType>
          </Entry>
          <Entry>
            <Index>#x60b0</Index>
            <SubIndex>0</SubIndex>
            <BitLen>32</BitLen>
            <Name></Name>
            <DataType>UINT32</DataType>
          </Entry>
          <Entry>
            <Index>#x60b1</Index>
            <SubIndex>0</SubIndex>
            <BitLen>32</BitLen>
            <Name></Name>
            <DataType>UINT32</DataType>
          </Entry>
          <Entry>
            <Index>#x60b2</Index>
            <SubIndex>0</SubIndex>
            <BitLen>16</BitLen>
            <Name></Name>
            <DataType>UINT16</DataType>
          </Entry>
          <Entry>
            <Index>#x6060</Index>
            <SubIndex>0</SubIndex>
            <BitLen>8</BitLen>
            <Name></Name>
            <DataType>UINT8</DataType>
          </Entry>
          <Entry>
            <Index>#x2078</Index>
            <SubIndex>1</SubIndex>
            <BitLen>16</BitLen>
            <Name></Name>
            <DataType>UINT16</DataType>
          </Entry>
          <Entry>
            <Index>#x60b8</Index>
            <SubIndex>0</SubIndex>
            <BitLen>16</BitLen>
            <Name></Name>
            <DataType>UINT16</DataType>
          </Entry>
        </RxPdo>
        <TxPdo Sm="3" Fixed="1" Mandatory="1">
          <Index>#x1a00</Index>
          <Name></Name>
          <Entry>
            <Index>#x6041</Index>
            <SubIndex>0</SubIndex>
            <BitLen>16</BitLen>
            <Name></Name>
            <DataType>UINT16</DataType>
          </Entry>
          <Entry>
            <Index>#x6064</Index>
            <SubIndex>0</SubIndex>
            <BitLen>32</BitLen>
            <Name></Name>
            <DataType>UINT32</DataType>
          </Entry>
          <Entry>
            <Index>#x606c</Index>
            <SubIndex>0</SubIndex>
            <BitLen>32</BitLen>
            <Name></Name>
            <DataType>UINT32</DataType>
          </Entry>
          <Entry>
            <Index>#x6077</Index>
            <SubIndex>0</SubIndex>
            <BitLen>16</BitLen>
            <Name></Name>
            <DataType>UINT16</DataType>
          </Entry>
          <Entry>
            <Index>#x6061</Index>
            <SubIndex>0</SubIndex>
            <BitLen>8</BitLen>
            <Name></Name>
            <DataType>UINT8</DataType>
          </Entry>
          <Entry>
            <Index>#x2071</Index>
            <SubIndex>1</SubIndex>
            <BitLen>16</BitLen>
            <Name></Name>
            <DataType>UINT16</DataType>
          </Entry>
          <Entry>
            <Index>#x60b9</Index>
            <SubIndex>0</SubIndex>
            <BitLen>16</BitLen>
            <Name></Name>
            <DataType>UINT16</DataType>
          </Entry>
          <Entry>
            <Index>#x60ba</Index>
            <SubIndex>0</SubIndex>
            <BitLen>32</BitLen>
            <Name></Name>
            <DataType>UINT32</DataType>
          </Entry>
          <Entry>
            <Index>#x60bb</Index>
            <SubIndex>0</SubIndex>
            <BitLen>32</BitLen>
            <Name></Name>
            <DataType>UINT32</DataType>
          </Entry>
        </TxPdo>
      </Device>
    </Devices>
  </Descriptions>
</EtherCATInfo>



-- 
Pablo Iñigo Blasco.
http://geus.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20140220/5f9d433d/attachment-0002.htm>


More information about the Etherlab-users mailing list