--- a/ethercat_tests/wago_higen/ethercat@etherlab/master@EthercatNode/config.xml Fri Apr 05 21:47:37 2013 +0900
+++ b/ethercat_tests/wago_higen/ethercat@etherlab/master@EthercatNode/config.xml Thu Apr 11 10:32:58 2013 +0200
@@ -19,6 +19,19 @@
<RevisionNo>65536</RevisionNo>
<SerialNo>0</SerialNo>
</Info>
+ <Mailbox>
+ <Send>
+ <Start>0</Start>
+ <Length>0</Length>
+ </Send>
+ <Recv>
+ <Start>0</Start>
+ <Length>0</Length>
+ </Recv>
+ <CoE>
+ <InitCmds/>
+ </CoE>
+ </Mailbox>
</Slave>
<Slave>
<Info>
@@ -31,6 +44,19 @@
<RevisionNo>1048576</RevisionNo>
<SerialNo>0</SerialNo>
</Info>
+ <Mailbox>
+ <Send>
+ <Start>0</Start>
+ <Length>0</Length>
+ </Send>
+ <Recv>
+ <Start>0</Start>
+ <Length>0</Length>
+ </Recv>
+ <CoE>
+ <InitCmds/>
+ </CoE>
+ </Mailbox>
</Slave>
<Slave>
<Info>
@@ -55,6 +81,47 @@
<RevisionNo>2</RevisionNo>
<SerialNo>0</SerialNo>
</Info>
+ <Mailbox>
+ <Send>
+ <Start>0</Start>
+ <Length>0</Length>
+ </Send>
+ <Recv>
+ <Start>0</Start>
+ <Length>0</Length>
+ </Recv>
+ <CoE>
+ <InitCmds>
+ <InitCmd>
+ <Transition>II</Transition>
+ <Comment>Configure limit switches signal</Comment>
+ <Timeout>0</Timeout>
+ <Ccs>0</Ccs>
+ <Index>8229</Index>
+ <SubIndex>0</SubIndex>
+ <Data>07</Data>
+ </InitCmd>
+ <InitCmd>
+ <Transition>II</Transition>
+ <Comment></Comment>
+ <Timeout>0</Timeout>
+ <Ccs>0</Ccs>
+ <Index>24800</Index>
+ <SubIndex>0</SubIndex>
+ <Data>05DC</Data>
+ </InitCmd>
+ <InitCmd>
+ <Transition>II</Transition>
+ <Comment></Comment>
+ <Timeout>0</Timeout>
+ <Ccs>0</Ccs>
+ <Index>24801</Index>
+ <SubIndex>0</SubIndex>
+ <Data>05DC</Data>
+ </InitCmd>
+ </InitCmds>
+ </CoE>
+ </Mailbox>
</Slave>
</Config>
</EtherCATConfig>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ethercat_tests/wago_higen/ethercat@etherlab/master@EthercatNode/process_variables.xml Thu Apr 11 10:32:58 2013 +0200
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<ProcessVariables xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <variable Name="Digital_IO" Comment="Transfering inputs to outputs">
+ <ReadFrom Position="3" Index="24829" SubIndex="0"/>
+ <WriteTo Position="3" Index="24830" SubIndex="1"/>
+ </variable>
+</ProcessVariables>
--- a/ethercat_tests/wago_higen/ethercat@etherlab/modules/Higen_EDA7000_CoE_ver16_with_variablePDO_modif.xml Fri Apr 05 21:47:37 2013 +0900
+++ b/ethercat_tests/wago_higen/ethercat@etherlab/modules/Higen_EDA7000_CoE_ver16_with_variablePDO_modif.xml Thu Apr 11 10:32:58 2013 +0200
@@ -3061,15 +3061,7 @@
</Entry>
</TxPdo>
<Mailbox>
- <CoE DS402Channels="1" CompleteAccess="false" PdoUpload="false" PdoConfig="true" PdoAssign="true" SdoInfo="false">
- <InitCmd>
- <Transition>PS</Transition>
- <Index>#x2025</Index>
- <SubIndex>0</SubIndex>
- <Data>0004</Data>
- <Comment>Digital Inputs Reverse Setting ([2]ESTOP, [1]CW, [0]CCW)</Comment>
- </InitCmd>
- </CoE>
+ <CoE DS402Channels="1" CompleteAccess="false" PdoUpload="false" PdoConfig="true" PdoAssign="true" SdoInfo="false"/>
</Mailbox>
<Dc>
<OpMode>
--- a/etherlab/EthercatCIA402Slave.py Fri Apr 05 21:47:37 2013 +0900
+++ b/etherlab/EthercatCIA402Slave.py Thu Apr 11 10:32:58 2013 +0200
@@ -51,8 +51,7 @@
}
"""
-BLOCK_FUNTION_DEFINITION_TEMPLATE = """ if (!__CIA402Node_%(location)s.axis->__mcl_func_MC_%(blocktype)s)
-__CIA402Node_%(location)s.axis->__mcl_func_MC_%(blocktype)s = __%(blocktype)s_%(location)s;"""
+BLOCK_FUNTION_DEFINITION_TEMPLATE = " __CIA402Node_%(location)s.axis->__mcl_func_MC_%(blocktype)s = __%(blocktype)s_%(location)s;"
GLOBAL_INSTANCES = [
{"blocktype": "GetTorqueLimit",
--- a/etherlab/plc_cia402node.c Fri Apr 05 21:47:37 2013 +0900
+++ b/etherlab/plc_cia402node.c Thu Apr 11 10:32:58 2013 +0200
@@ -55,10 +55,8 @@
int __init_%(location)s()
{
+ __FirstTick = 1;
%(init_entry_variables)s
- *__IW%(location)s_0 = __MK_Alloc_AXIS_REF();
- __CIA402Node_%(location)s.axis = __MK_GetPublic_AXIS_REF(*__IW%(location)s_0);
- __CIA402Node_%(location)s.axis->NetworkPosition = %(slave_pos)d;
*(__CIA402Node_%(location)s.ModesOfOperation) = 0x08;
return 0;
}
@@ -69,13 +67,15 @@
void __retrieve_%(location)s()
{
-%(fieldbus_interface_definition)s
-
IEC_UINT statusword_inactive = *(__CIA402Node_%(location)s.StatusWord) & __InactiveMask;
IEC_UINT statusword_active = *(__CIA402Node_%(location)s.StatusWord) & __ActiveMask;
if (__FirstTick) {
+ *__IW%(location)s_0 = __MK_Alloc_AXIS_REF();
+ __CIA402Node_%(location)s.axis = __MK_GetPublic_AXIS_REF(*__IW%(location)s_0);
+ __CIA402Node_%(location)s.axis->NetworkPosition = %(slave_pos)d;
%(init_axis_params)s
+%(fieldbus_interface_definition)s
__FirstTick = 0;
}