104 </xsd:element> |
104 </xsd:element> |
105 </xsd:schema> |
105 </xsd:schema> |
106 """ % ("\n".join(["""\ |
106 """ % ("\n".join(["""\ |
107 <xsd:attribute name="Enable%s" type="xsd:boolean" |
107 <xsd:attribute name="Enable%s" type="xsd:boolean" |
108 use="optional" default="false"/>""" % category |
108 use="optional" default="false"/>""" % category |
109 for category, variables in EXTRA_NODE_VARIABLES]) + AxisXSD) |
109 for category, variables in EXTRA_NODE_VARIABLES]) + AxisXSD) |
110 |
110 |
111 NODE_PROFILE = 402 |
111 NODE_PROFILE = 402 |
112 EditorType = CIA402NodeEditor |
112 EditorType = CIA402NodeEditor |
113 |
113 |
114 ConfNodeMethods = [ |
114 ConfNodeMethods = [ |
234 (input["name"].upper(), |
234 (input["name"].upper(), |
235 "__GET_VAR(data__->%s)" % input["name"].upper()) |
235 "__GET_VAR(data__->%s)" % input["name"].upper()) |
236 for input in blocktype_infos["inputs"]] |
236 for input in blocktype_infos["inputs"]] |
237 ]) |
237 ]) |
238 |
238 |
239 return_outputs = "\n".join(["""\ |
239 return_outputs = "\n".join([ |
|
240 """\ |
240 __SET_VAR(data__->,%(output_name)s,, |
241 __SET_VAR(data__->,%(output_name)s,, |
241 __GET_VAR(%(blockname)s->%(output_name)s));""" % locals() |
242 __GET_VAR(%(blockname)s->%(output_name)s));""" % locals() |
242 for output_name in ["DONE", "BUSY", "ERROR"] + [ |
243 for output_name in ["DONE", "BUSY", "ERROR"] + [ |
243 output["name"].upper() |
244 output["name"].upper() |
244 for output in blocktype_infos["outputs"]] |
245 for output in blocktype_infos["outputs"]] |
245 ]) |
246 ]) |
246 |
247 |
247 fieldbus_interface_declaration.append(""" |
248 fieldbus_interface_declaration.append(""" |
248 extern void ETHERLAB%(ucase_blocktype)s_body__(ETHERLAB%(ucase_blocktype)s* data__); |
249 extern void ETHERLAB%(ucase_blocktype)s_body__(ETHERLAB%(ucase_blocktype)s* data__); |
249 void __%(blocktype)s_%(location_str)s(MC_%(ucase_blocktype)s *data__) { |
250 void __%(blocktype)s_%(location_str)s(MC_%(ucase_blocktype)s *data__) { |
250 __DECLARE_GLOBAL_PROTOTYPE(ETHERLAB%(ucase_blocktype)s, %(blockname)s); |
251 __DECLARE_GLOBAL_PROTOTYPE(ETHERLAB%(ucase_blocktype)s, %(blockname)s); |
331 extern_located_variables_declaration, entry_variables, |
332 extern_located_variables_declaration, entry_variables, |
332 init_entry_variables]) |
333 init_entry_variables]) |
333 |
334 |
334 # Write generated content to CIA402 node file |
335 # Write generated content to CIA402 node file |
335 Gen_CIA402Nodefile_path = os.path.join(buildpath, |
336 Gen_CIA402Nodefile_path = os.path.join(buildpath, |
336 "cia402node_%s.c" % location_str) |
337 "cia402node_%s.c" % location_str) |
337 cia402nodefile = open(Gen_CIA402Nodefile_path, 'w') |
338 cia402nodefile = open(Gen_CIA402Nodefile_path, 'w') |
338 cia402nodefile.write(plc_cia402node_code % locals()) |
339 cia402nodefile.write(plc_cia402node_code % locals()) |
339 cia402nodefile.close() |
340 cia402nodefile.close() |
340 |
341 |
341 return [(Gen_CIA402Nodefile_path, '"-I%s"' % os.path.abspath(self.GetCTRoot().GetIECLibPath()))], "", True |
342 return [(Gen_CIA402Nodefile_path, '"-I%s"' % os.path.abspath(self.GetCTRoot().GetIECLibPath()))], "", True |