python读取S7-1200 DB块 读DB区 使用的方法依旧是read_area d ef r e ad_area(sel f, ar ea, d bn um be r, st ar t,size)area是PLC内各寄存区的代码,具体参考下表 dbnumber是DB块编号,可以在DB块属性中常规选项中查看到,start为寄存区起始地址,size是DB块完整的长度,因为DB块中可以有各种...
importsnap7fromsnap7.utilimport* PLCArray = [] ## 连接PLC 加入数组defS7_200_Connect(ip,type, rack, slot, name):plcObj = snap7.client.Client() plcObj.disconnect() plcObj.set_connection_type(type) try: plcObj.connect(ip, rack, slot)except:print(f"连接状态:{ip}连接...
python读取S7-1200DB块 python读取S7-1200 DB块 读DB区 使⽤的⽅法依旧是read_area d ef r e ad_area(sel f, ar ea, d bn um be r, st ar t,size)area是PLC内各寄存区的代码,具体参考下表 dbnumber是DB块编号,可以在DB块属性中常规选项中查看到,start为寄存区起始地址,size是DB块完整的...