A basic PCOM implementation in Python
Project description
PCOM
A very basic Unitronics PCOM protocol implementation in Python.
How to use
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)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
pcom-0.1-py3-none-any.whl
(11.8 kB
view hashes)