Skip to main content

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.2-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file pcom-0.2-py3-none-any.whl.

File metadata

  • Download URL: pcom-0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.11.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.15

File hashes

Hashes for pcom-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7e914fd38c41c07903c1b64d927ccd847835ab0bb5b3b966c3c13ec691fb23a1
MD5 c46bd23ddca0099ac91f9fd987b144ec
BLAKE2b-256 12ede94cdac168f8e95deb403fa807740b2e6703e301752f64100c61d0e3d410

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page