Adding error message when SFC Transition body is not well formatted (no reference to transition name)
authorlaurent
Wed, 15 Feb 2012 00:27:31 +0100
changeset 644 6ff54a34102b
parent 643 941eda65db7a
child 645 41782a92c2de
Adding error message when SFC Transition body is not well formatted (no reference to transition name)
PLCGenerator.py
--- a/PLCGenerator.py	Wed Feb 15 00:26:30 2012 +0100
+++ b/PLCGenerator.py	Wed Feb 15 00:27:31 2012 +0100
@@ -1186,6 +1186,8 @@
                                 transition_infos["content"] = [("\n%s:= "%self.CurrentIndent, ())] + expression + [(";\n", ())]
                                 self.SFCComputedBlocks += self.Program
                                 self.Program = []
+                    if not transition_infos.has_key("content"):
+                        raise PLCGenException, _("Transition \"%s\" body must contain an output variable or coil referring to its name") % transitionValues["value"]
                 self.TagName = previous_tagname
             elif transitionValues["type"] == "connection":
                 body = pou.getbody()