Skip to main content

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())

Release files for productivity 0.14.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for productivity 0.14.2
File Size Uploaded
productivity-0.14.2.tar.gz 18.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for productivity 0.14.2
File Interpreter ABI Platform
productivity-0.14.2-py3-none-any.whl Python 3 none any Details

Total release size: 37.5 kB

Release files / productivity-0.14.2.tar.gz

Download URL productivity-0.14.2.tar.gz
Size 18.8 kB
Tags Source
SHA-256 checksum
How to use checksums
119b1b520442e22704394656a191dc924f0b4b16e4bfad1faba4076cde0dffc9
BLAKE2b-256 checksum
How to use checksums
d6527de736a1f9c3c2e3fb9e2b906fd3eab72ae762ba9c958c9670ba46d9b53c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / productivity-0.14.2-py3-none-any.whl

Download URL productivity-0.14.2-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ede4af0cd30912723c713cef190ea499397c07539d6adf5e2429ed5d4d498797
BLAKE2b-256 checksum
How to use checksums
6f63158ae53cb8517b85868f0176c552749180daf543d4b21d7c12830efdb896
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page