如何通过pyads更改twincat plc输出...
import pyads
plc = pyads.Connection('192.168.102.229.1.1', 801)
plc.open()
vacuum_21 = plc.read_by_name('.O_Vakuum_Wafer_21_EIN',pyads.PLCTYPE_USINT)
print("Vacuum 21 : " + str(vacuum_21))
plc.write_by_name('.O_Vakuum_Wafer_21_EIN', 0 ,pyads.PLCTYPE_USINT)
vacuum_21 = plc.read_by_name('.O_Vakuum_Wafer_21_EIN',pyads.PLCTYPE_USINT)
print("Vacuum 21 : " + str(vacuum_21))
plc.close()
重新启动:C:\ Users \ Operator \ AppData \ Local \ Programs \ Python \ Python37- 32 \ twincat_trial.py
真空21:1
真空21:1
答案 0 :(得分:0)
因为输出可能会被plc覆盖。