disallow setting IEC location addresses for TIME, DATE, DT and TOD variables
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Thu, 01 Jun 2017 14:37:14 +0300
changeset 1686 85fdcc04da25
parent 1685 578a46fb6b30
child 1687 dde952da3aa4
disallow setting IEC location addresses for TIME, DATE, DT and TOD variables

Size of these types is not defined and depends on the implementation
(IEC 61131-3 2.3.1).
PLCControler.py
--- a/PLCControler.py	Tue May 30 17:09:33 2017 +0300
+++ b/PLCControler.py	Thu Jun 01 14:37:14 2017 +0300
@@ -1789,6 +1789,10 @@
         if isinstance(typename, TupleType) or self.GetBlockType(typename) is not None:
             return False
 
+        # the size of these types is implementation dependend
+        if typename in ["TIME", "DATE", "DT", "TOD"]:
+            return False
+        
         datatype = self.GetDataType(typename, debug)
         if datatype is not None:
             return self.IsLocatableDataType(datatype)