ppython_Python pcom包_程序模块 - PyPI - Python中文网
生活随笔
收集整理的這篇文章主要介紹了
ppython_Python pcom包_程序模块 - PyPI - Python中文网
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
PCOM
在python中一個非常基本的unitronics pcom協議實現。
如何使用from pcom import commands
from pcom.plc import EthernetPlc
with EthernetPlc(address=('192.168.5.43', 1616)) as plc:
# Read realtime clock
c = commands.ReadRtc()
res = plc.send(c)
print(res)
# Set realtime clock
c = commands.SetRtc(value=datetime.now())
plc.send(c)
# Set MB 300 through 304
values = [True, False, True, True, False]
c = commands.SetBits(code=commands.SetBits.MEMORY, address=300, values=values)
plc.send(c)
歡迎加入QQ群-->: 979659372
推薦PyPI第三方庫
總結
以上是生活随笔為你收集整理的ppython_Python pcom包_程序模块 - PyPI - Python中文网的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 对象过滤某个属性 循环 php_37道P
- 下一篇: openresty—实现缓存前移