Skip to main content

Python driver for AutomationDirect Productivity Series PLCs.

Project description

Productivity

Python driver and command-line tool for AutomationDirect Productivity Series PLCs.

Installation

uv pip install productivity

Usage

PLC Configuration

This driver uses Modbus TCP/IP for communication. Unlike the ClickPLC, modbus addresses need to be manually configured in the Productivity PLC firmware (see manual).

To use this driver, go to Write Program → Tag Database, scroll down to the values you care about, and double click the Mod Start cell of each value to assign an address. Then, go to File → Export → Tags to export a csv file. The file is used here so you don't need to remember the addresses.

Command Line

To print the tags and their values, simply call the library with the PLC IP address and the tags file.

$ productivity the-plc-ip-address path/to/tags.csv

Use --set to set values on the PLC:

$ productivity the-plc-ip-address path/to/tags.csv -s "{int_test: 4, float_test: 4.45, string_test: foo}"

The --set parameter takes YAML, a simple data format that allows you to easily set multiple tags at once.

See productivity --help for more.

Python

This driver uses Python async/await syntax to asynchronously communicate with a Productivity2000 PLC. For example:

import asyncio
from productivity import ProductivityPLC

async def run():
    async with ProductivityPLC('the-plc-ip-address', 'path/to/tags.csv') as plc:
        print(await plc.get())

asyncio.run(run())

It is also possible to set tag values:

async def run():
    async with ProductivityPLC('the-plc-ip-address', 'path/to/tags.csv') as plc:
        await plc.set(start=True, setpoint=1.1)

asyncio.run(run())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

productivity-0.14.1.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

productivity-0.14.1-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file productivity-0.14.1.tar.gz.

File metadata

  • Download URL: productivity-0.14.1.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for productivity-0.14.1.tar.gz
Algorithm Hash digest
SHA256 bf3a63d2dcd54584c9e645dd4cb9031f7e0d223aa5017e52ca17e403b9d7902c
MD5 3fd56bc798d62f7edff337c7b335351e
BLAKE2b-256 c74d00aafa8da219b78f0dfcbadbb5fe464fadf2d89762328cb78ca9cced9d2a

See more details on using hashes here.

File details

Details for the file productivity-0.14.1-py3-none-any.whl.

File metadata

  • Download URL: productivity-0.14.1-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for productivity-0.14.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7559f93c17c9d49b82a047a2c51dde500c20e9f9d3a98519b745ae3dee834a45
MD5 c01d2a870d30f4558773333c6e240a19
BLAKE2b-256 d27d6a18a06396ecfe833bdb0babcbe3b3b462df22cc74eb526201451ff23dad

See more details on using hashes here.

Supported by

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