用pycomm写PLC标签

2024-06-12 18:51:21 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图用pycomm lib将1或0写入我的plc标记“N7:2”,但它不起作用。你知道吗

当前正在尝试的pycomm;cpppo和pylogix没有起作用。你知道吗

from pycomm.ab_comm.slc import Driver as SlcDriver

plc = SlcDriver()

if plc.open('10.12.108.236'):

   plc.write_tag('N7:2', 1)
   print(plc.read_tag('N7:2', 1))

plc.close()

DataError: Error(must be str, not bytes) packing the values to write to the SLC write_tag(N7:2,1)


Tags: thetofrom标记ablibtagwrite