--- a/etherlab/EthercatCIA402Slave.py Thu Apr 04 17:50:43 2013 +0900
+++ b/etherlab/EthercatCIA402Slave.py Fri Apr 05 00:09:54 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;" {"blocktype": "GetTorqueLimit",
--- a/etherlab/plc_cia402node.c Thu Apr 04 17:50:43 2013 +0900
+++ b/etherlab/plc_cia402node.c Fri Apr 05 00:09:54 2013 +0200
@@ -55,10 +55,8 @@
int __init_%(location)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;
@@ -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;
+ *__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; +%(fieldbus_interface_definition)s