Browse Source

新增部分垛位处理代码

oldwine 3 months ago
parent
commit
1e2b4ee58c
2 changed files with 10 additions and 0 deletions
  1. 6 0
      conf/6#nodes.csv
  2. 4 0
      utils/s7data.py

+ 6 - 0
conf/6#nodes.csv

@@ -44,3 +44,9 @@ L5
 L6坯头位置,int,201,4,0,2,TRUE,FALSE,500,3
 L7坯头位置,int,201,6,0,2,TRUE,FALSE,500,3
 L8坯头位置,int,201,8,0,2,TRUE,FALSE,500,3
+步进冷床堆垛高度,int,302,2,0,2,TRUE,FALSE,500,3
+步进冷床顶层组数,int,302,4,0,2,TRUE,FALSE,500,3
+步进冷床各组数量,int_list,302,6,0,24,TRUE,FALSE,500,3
+步进冷床摆放方式,int,302,30,0,2,TRUE,FALSE,500,3
+步进冷床行车状态,int,302,32,0,2,TRUE,FALSE,500,3
+步进冷床更新信号,bool,302,34,0,1,TRUE,FALSE,500,3

+ 4 - 0
utils/s7data.py

@@ -76,6 +76,10 @@ class S7data:
             data = self.node_data[name][2:2+int.from_bytes(self.node_data[name][1:2])].decode('gbk')
         elif self.nodes[name]['type'] == 'wstring':
             data = self.node_data[name][4:].decode(encoding='utf-16be')
+        elif self.nodes[name]['type'] == 'int_list':
+            data = []
+            for i in range(0, int(self.nodes[name]['size']), 2):
+                data.append(snap7.util.get_int(self.node_data[name], i))
         else:
             warnings.warn('暂不支持的类型:' + self.nodes[name]['type'])
             if self.logger: