check during program generation whether source signal is defined for single task
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Mon, 26 Dec 2016 13:49:38 +0300
changeset 1614 f8f05f849831
parent 1613 41ca586da9dc
child 1615 af9b0ccb418e
check during program generation whether source signal is defined for single task
PLCGenerator.py
--- a/PLCGenerator.py	Fri Dec 23 18:40:31 2016 +0300
+++ b/PLCGenerator.py	Mon Dec 26 13:49:38 2016 +0300
@@ -393,6 +393,11 @@
             single = task.getsingle()
             # Single argument if exists
             if single is not None:
+                if len(single) == 0:
+                    msg = _("Source signal has to be defined for single task '{a1}' in resource '{a2}.{a3}'.").\
+                          format(a1 = task.getname(), a2 = config_name, a3 = resource.getname())
+                    raise PLCGenException, msg
+
                 if single[0]=='[' and single[-1]==']' :
                     SNGLKW = "MULTI"
                 else: