上传者: 42730527
|
上传时间: 2023-03-14 17:14:01
|
文件大小: 6KB
|
文件类型: RAR
可直接读取PLC的I,Q,M,V
可写入PLC的I,Q,M,V
包含B,W,D等寄存器的读取写入
以Q区读写为例:
a = c.WriteData('Q', 0.0, 1)
print(a)
a = c.ReadData('Q', 0.0)
print(a)
a = c.WriteData('QB', 0, 2)
print(a)
a = c.ReadData('QB', 0)
print(a)
a = c.WriteData('QW', 0, 258)
print(a)
a = c.ReadData('QW', 0)
print(a)
a = c.WriteData('QD', 0, 65538)
print(a)
a = c.ReadData('QD', 0)
print(a)
根据返回值可判断当前错误状态