# HG changeset patch # User Laurent Bessard # Date 1372100602 -7200 # Node ID 6bbe937999560e5b755d4d215b3675f41c33ca91 # Parent 91c10856adaac129f615f6049dae555cab7644c3 Replaced location for axis ref from %IW(location).0 to %IW(location).402. Added location for network position at %IW(location). diff -r 91c10856adaa -r 6bbe93799956 ethercat_tests/wago_higen/ethercat@etherlab/master@EthercatNode/config.xml --- a/ethercat_tests/wago_higen/ethercat@etherlab/master@EthercatNode/config.xml Mon Jun 24 09:23:28 2013 +0200 +++ b/ethercat_tests/wago_higen/ethercat@etherlab/master@EthercatNode/config.xml Mon Jun 24 21:03:22 2013 +0200 @@ -1,127 +1,127 @@ - - - - - - - 00 - 00 - - - - - EK1100 - 0 - 0 - - 2 - 72100946 - 65536 - 0 - - - - 0 - 0 - - - 0 - 0 - - - - - - - - - EL1088 - 1 - 0 - - 2 - 71315538 - 1048576 - 0 - - - - 0 - 0 - - - 0 - 0 - - - - - - - - - EL2088 - 2 - 0 - - 2 - 136851538 - 1048576 - 0 - - - - - EDA7000 CoE Drive - 3 - 0 - - 1573 - 1768449365 - 3 - 0 - - - - 0 - 0 - - - 0 - 0 - - - - - II - Configure limit switches signal - 0 - 0 - 8229 - 0 - 07 - - - II - - 0 - 0 - 24800 - 0 - 05DC - - - II - - 0 - 0 - 24801 - 0 - 05DC - - - - - - - + + + + + + + 00 + 00 + + + + + EK1100 + 0 + 0 + + 2 + 72100946 + 65536 + 0 + + + + 0 + 0 + + + 0 + 0 + + + + + + + + + EL1088 + 1 + 0 + + 2 + 71315538 + 1048576 + 0 + + + + 0 + 0 + + + 0 + 0 + + + + + + + + + EL2088 + 2 + 0 + + 2 + 136851538 + 1048576 + 0 + + + + + EDA7000 CoE Drive + 3 + 0 + + 1573 + 1768449365 + 3 + 0 + + + + 0 + 0 + + + 0 + 0 + + + + + II + Configure limit switches signal + 0 + 0 + 8229 + 0 + 07 + + + II + + 0 + 0 + 24800 + 0 + 05DC + + + II + + 0 + 0 + 24801 + 0 + 05DC + + + + + + + diff -r 91c10856adaa -r 6bbe93799956 ethercat_tests/wago_higen/ethercat@etherlab/master@EthercatNode/higen@EthercatCIA402Slave/confnode.xml --- a/ethercat_tests/wago_higen/ethercat@etherlab/master@EthercatNode/higen@EthercatCIA402Slave/confnode.xml Mon Jun 24 09:23:28 2013 +0200 +++ b/ethercat_tests/wago_higen/ethercat@etherlab/master@EthercatNode/higen@EthercatCIA402Slave/confnode.xml Mon Jun 24 21:03:22 2013 +0200 @@ -1,2 +1,2 @@ - - + + diff -r 91c10856adaa -r 6bbe93799956 ethercat_tests/wago_higen/ethercat@etherlab/master@EthercatNode/process_variables.xml --- a/ethercat_tests/wago_higen/ethercat@etherlab/master@EthercatNode/process_variables.xml Mon Jun 24 09:23:28 2013 +0200 +++ b/ethercat_tests/wago_higen/ethercat@etherlab/master@EthercatNode/process_variables.xml Mon Jun 24 21:03:22 2013 +0200 @@ -1,2 +1,2 @@ - - + + diff -r 91c10856adaa -r 6bbe93799956 ethercat_tests/wago_higen/plc.xml --- a/ethercat_tests/wago_higen/plc.xml Mon Jun 24 09:23:28 2013 +0200 +++ b/ethercat_tests/wago_higen/plc.xml Mon Jun 24 21:03:22 2013 +0200 @@ -1,1049 +1,1049 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CLOCK - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - CLOCK - - - - - - - CLOCK - - - - - - - 4000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Axis - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1800.0 - - - - - - - 360.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 360.0 - - - - - - - -360.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - BOOL#TRUE - - - - - - - - - - - Pn - - - - - - - Axis - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 10 - - - - - - - BOOL#TRUE - - - - - - - - - - - Vn - - - - - - - -1800.0 - - - - - - - Pn - - - - - - - 360.0 - - - - - - - 0.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0.0 - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CLOCK + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + CLOCK + + + + + + + CLOCK + + + + + + + 4000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Axis + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1800.0 + + + + + + + 360.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 360.0 + + + + + + + -360.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BOOL#TRUE + + + + + + + + + + + Pn + + + + + + + Axis + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10 + + + + + + + BOOL#TRUE + + + + + + + + + + + Vn + + + + + + + -1800.0 + + + + + + + Pn + + + + + + + 360.0 + + + + + + + 0.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.0 + + + + + + + + + + + + + + + + + + + diff -r 91c10856adaa -r 6bbe93799956 etherlab/EthercatCIA402Slave.py --- a/etherlab/EthercatCIA402Slave.py Mon Jun 24 09:23:28 2013 +0200 +++ b/etherlab/EthercatCIA402Slave.py Mon Jun 24 21:03:22 2013 +0200 @@ -105,6 +105,11 @@ "tooltip" : _("Initiate Drag'n drop of Axis ref located variable"), "method" : "_getCIA402AxisRef", "push": True}, + {"bitmap" : "CIA402NetPos", + "name" : _("Axis Pos"), + "tooltip" : _("Initiate Drag'n drop of Network position located variable"), + "method" : "_getCIA402NetworkPosition", + "push": True}, ] #-------------------------------------------------- @@ -128,12 +133,20 @@ def GetVariableLocationTree(self): axis_name = self.CTNName() current_location = self.GetCurrentLocation() - children = [{"name": "%s Axis Ref" % (axis_name), + children = [{"name": "%s Network Position" % (axis_name), + "type": LOCATION_VAR_INPUT, + "size": "W", + "IEC_type": "UINT", + "var_name": axis_name, + "location": "%%IW%s" % (".".join(map(str, current_location))), + "description": "", + "children": []}, + {"name": "%s Axis Ref" % (axis_name), "type": LOCATION_VAR_INPUT, "size": "W", "IEC_type": "AXIS_REF", "var_name": axis_name, - "location": "%%IW%s.0" % (".".join(map(str, current_location))), + "location": "%%IW%s.402" % (".".join(map(str, current_location))), "description": "", "children": []}] children.extend(self.CTNParent.GetDeviceLocationTree(self.GetSlavePos(), current_location, axis_name)) @@ -150,14 +163,22 @@ "EtherLab%s" % block_infos["blocktype"], "") for block_infos in FIELDBUS_INTERFACE_GLOBAL_INSTANCES] + def StartDragNDrop(self, data): + data_obj = wx.TextDataObject(str(data)) + dragSource = wx.DropSource(self.GetCTRoot().AppFrame) + dragSource.SetData(data_obj) + dragSource.DoDragDrop() + + def _getCIA402NetworkPosition(self): + self.StartDragNDrop( + ("%%IW%s" % ".".join(map(str, self.GetCurrentLocation())), + "location", "UINT", self.CTNName() + "_Pos", "")) + def _getCIA402AxisRef(self): - data = wx.TextDataObject(str( - ("%%IW%s.0" % ".".join(map(str, self.GetCurrentLocation())), - "location", "AXIS_REF", self.CTNName(), ""))) - dragSource = wx.DropSource(self.GetCTRoot().AppFrame) - dragSource.SetData(data) - dragSource.DoDragDrop() - + self.StartDragNDrop( + ("%%IW%s.402" % ".".join(map(str, self.GetCurrentLocation())), + "location", "AXIS_REF", self.CTNName(), "")) + def CTNGenerate_C(self, buildpath, locations): current_location = self.GetCurrentLocation() diff -r 91c10856adaa -r 6bbe93799956 etherlab/images/CIA402NetPos.png Binary file etherlab/images/CIA402NetPos.png has changed diff -r 91c10856adaa -r 6bbe93799956 etherlab/images/icons.svg --- a/etherlab/images/icons.svg Mon Jun 24 09:23:28 2013 +0200 +++ b/etherlab/images/icons.svg Mon Jun 24 21:03:22 2013 +0200 @@ -43,9 +43,9 @@ pagecolor="#ffffff" id="base" showgrid="false" - inkscape:zoom="8.0000002" - inkscape:cx="294.02018" - inkscape:cy="814.50324" + inkscape:zoom="2.8284272" + inkscape:cx="713.91791" + inkscape:cy="892.4378" inkscape:window-x="0" inkscape:window-y="24" inkscape:current-layer="svg2" @@ -61601,6 +61601,344 @@ id="linearGradient13566-2" xlink:href="#linearGradient5175-3-6" inkscape:collect="always" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %%ImportESI ImportDatabase ScanNetwork editSlave editCIA402Slave CIA402AxisRef %% + y="120.42097">%%ImportESI ImportDatabase ScanNetwork editSlave editCIA402Slave CIA402AxisRef CIA402NetPos%% @@ -64066,4 +64404,135 @@ y="0" x="0" /> + + + + + + + + + + + + + + + + + + + P + O + S + + + + diff -r 91c10856adaa -r 6bbe93799956 etherlab/plc_cia402node.c --- a/etherlab/plc_cia402node.c Mon Jun 24 09:23:28 2013 +0200 +++ b/etherlab/plc_cia402node.c Mon Jun 24 21:03:22 2013 +0200 @@ -56,8 +56,10 @@ #define Halt 0x0100 -IEC_INT beremiz__IW%(location_str)s_0; -IEC_INT *__IW%(location_str)s_0 = &beremiz__IW%(location_str)s_0; +IEC_INT beremiz__IW%(location_str)s = %(slave_pos)s; +IEC_INT *__IW%(location_str)s = &beremiz__IW%(location_str)s; +IEC_INT beremiz__IW%(location_str)s_402; +IEC_INT *__IW%(location_str)s_402 = &beremiz__IW%(location_str)s_402; %(MCL_headers)s @@ -91,10 +93,10 @@ void __retrieve_%(location_str)s() { if (__FirstTick) { - *__IW%(location_str)s_0 = __MK_Alloc_AXIS_REF(); + *__IW%(location_str)s_402 = __MK_Alloc_AXIS_REF(); AxsPub.axis = - __MK_GetPublic_AXIS_REF(*__IW%(location_str)s_0); - AxsPub.axis->NetworkPosition = %(slave_pos)d; + __MK_GetPublic_AXIS_REF(*__IW%(location_str)s_402); + AxsPub.axis->NetworkPosition = beremiz__IW%(location_str)s; %(init_axis_params)s %(fieldbus_interface_definition)s __FirstTick = 0;