You have to load as follows:
Code:
loadusr -W emcec_conf ethercat-conf.xml
loadrt emcec
so that the real time part is loaded just after the config parser is ready.
Then add read/write function. For example:
Code:
addf emcec.read-all servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf emcec.write-all servo-thread
The xml file in the simples case is just a list of slaves. Please note
that "appTimePeriod" has to match the period of the servo-thread in
the example above.
Code:
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="10">
<slave idx="0" type="EK1100"/>
<slave idx="1" type="EL1008"/>
<slave idx="2" type="EL1808"/>
<slave idx="3" type="EL2808"/>
<slave idx="4" type="EL2808"/>
<slave idx="5" type="EL3162"/>
<slave idx="6" type="EL4132"/>
<slave idx="7" type="EL4132"/>
<slave idx="8" type="EL5151"/>
<slave idx="9" type="EL5152"/>
<slave idx="10" type="EL5101"/>
<slave idx="11" type="EL2521"/>
</master>
Here a more complex example with DC config, generic device, dynamic PDO mapping
and SDO initialization:
Code:
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="10">
<slave idx="0" type="EK1100"/>
<slave idx="1" type="EL1809"/>
<slave idx="2" type="EL1809"/>
<slave idx="3" type="EL2809"/>
<slave idx="4" type="EL4002"/>
<slave idx="5" type="EL4002"/>
<!-- EL6751 CANopen slave -->
<slave idx="6" type="generic" vid="00000002" pid="1a5f3052" configPdos="true">
<sdoConfig idx="f800" subIdx="complete">
<sdoDataRaw data="0A 00 05 02 80 00 1E 00"/>
<sdoDataRaw data="01 00 12 80 64 00"/>
</sdoConfig>
<sdoConfig idx="8000" subIdx="complete">
<sdoDataRaw data="2B 00 05 00 00 00 00 00"/>
<sdoDataRaw data="00 00 00 00 00 00 00 00"/>
<sdoDataRaw data="00 00 00 00 05 04 00 00"/>
<sdoDataRaw data="02 00 00 00 5F 1A 00 00"/>
<sdoDataRaw data="00 00 00 00 00 00 00 00"/>
<sdoDataRaw data="00 00 00 00 00 00 00 00"/>
<sdoDataRaw data="00 00 02 00 64 00 03 00"/>
<sdoDataRaw data="D0 07 00 00 01 01 00 00"/>
<sdoDataRaw data="0A 00"/>
</sdoConfig>
<sdoConfig idx="8001" subIdx="complete">
<sdoDataRaw data="01 00 01 00 00 00 FF 02"/>
<sdoDataRaw data="85 01 00 00 00 00 00 18"/>
</sdoConfig>
<sdoConfig idx="8002" subIdx="complete">
<sdoDataRaw data="01 00 00 00 00 00 FF 02"/>
<sdoDataRaw data="05 02 00 00 00 00 00 14"/>
</sdoConfig>
<syncManager idx="0" dir="out">
</syncManager>
<syncManager idx="1" dir="in">
</syncManager>
<syncManager idx="2" dir="out">
<pdo idx="1600">
<pdoEntry idx="7000" subIdx="01" bitLen="16" halPin="can-out" halType="bit"/>
</pdo>
</syncManager>
<syncManager idx="3" dir="in">
<pdo idx="1a00">
<pdoEntry idx="6000" subIdx="01" bitLen="16" halPin="can-in" halType="bit"/>
</pdo>
<pdo idx="1a80">
<pdoEntry idx="a000" subIdx="01" bitLen="8" halPin="can-slave-nodestate" halType="u32"/>
<pdoEntry idx="f100" subIdx="01" bitLen="8" halPin="can-error" halType="u32"/>
<pdoEntry idx="f100" subIdx="03" bitLen="16" halPin="can-state" halType="u32"/>
<pdoEntry idx="f100" subIdx="02" bitLen="1" halPin="can-diagflag" halType="bit"/>
<pdoEntry idx="a000" subIdx="02" bitLen="1" halPin="can-slave-diagflag" halType="bit"/>
<pdoEntry idx="0000" subIdx="00" bitLen="6"/>
</pdo>
</syncManager>
</slave>
<slave idx="7" type="EL2809"/>
<slave idx="8" type="EL7342">
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="-25000"/>
<watchdog divider="2498" intervals="2000"/>
</slave>
<slave idx="9" type="EL7342">
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="-25000"/>
<watchdog divider="2498" intervals="2000"/>
</slave>
<slave idx="10" type="EL9505"/>
</master>
You are right. Pin names are generated pending on the type of devide (except the
generic one). There is also a attribtute "name" for masters & slaves to override
the default index based naming.
I should do some work an docs :whistle: