fix issue with compiling SFC POU with non-connected transition (type "connection")
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Wed, 14 Dec 2016 12:31:06 +0300
changeset 1603 18279f12a6be
parent 1602 95ecb26fdc4e
child 1604 7f98c091be56
fix issue with compiling SFC POU with non-connected transition (type "connection")
PLCGenerator.py
--- a/PLCGenerator.py	Tue Dec 13 17:47:34 2016 +0300
+++ b/PLCGenerator.py	Wed Dec 14 12:31:06 2016 +0300
@@ -763,7 +763,10 @@
                     content = instance.getconditionContent()
                     if content["type"] == "connection":
                         self.ConnectionTypes[content["value"]] = "BOOL"
-                        for link in content["value"].getconnections():
+                        connections = content["value"].getconnections()
+                        if not connections:
+                            raise PLCGenException, _("SFC transition in POU \"%s\" must be connected.") % self.Name
+                        for link in connections:                        
                             connected = self.GetLinkedConnector(link, body)
                             if connected is not None and not self.ConnectionTypes.has_key(connected):
                                 for related in self.ExtractRelatedConnections(connected):