Productivity
============
##### NOTE: This is in very early stages of development.
Python ≥3.8 driver and command-line tool for [AutomationDirect Productivity Series PLCs](https://www.automationdirect.com/adc/overview/catalog/programmable_controllers/productivity_series_controllers).
<p align="center">
<img src="https://www.automationdirect.com/images/overviews/p-series-cpus_400.jpg" />
</p>
Installation
============
```
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](https://cdn.automationdirect.com/static/manuals/p2userm/p2userm.pdf)).
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](https://learnxinyminutes.com/docs/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 ≥3.5's async/await syntax to asynchronously communicate with
a Productivity2000 PLC. For example (note that asyncio.run() requires Python >=3.7):
```python
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:
```python
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())
```
Raw data
{
"_id": null,
"home_page": "https://github.com/numat/productivity/",
"name": "productivity",
"maintainer": "Alex Ruddick",
"docs_url": null,
"requires_python": "",
"maintainer_email": "alex@numat-tech.com",
"keywords": "",
"author": "Patrick Fuller",
"author_email": "pat@numat-tech.com",
"download_url": "https://files.pythonhosted.org/packages/89/03/51dbb4e32109698806bbb45265dafb6e44c0544e5b7877994b1b4217e433/productivity-0.11.1.tar.gz",
"platform": null,
"description": "Productivity\n============\n\n##### NOTE: This is in very early stages of development.\n\nPython \u22653.8 driver and command-line tool for [AutomationDirect Productivity Series PLCs](https://www.automationdirect.com/adc/overview/catalog/programmable_controllers/productivity_series_controllers).\n\n<p align=\"center\">\n <img src=\"https://www.automationdirect.com/images/overviews/p-series-cpus_400.jpg\" />\n</p>\n\nInstallation\n============\n\n```\npip install productivity\n```\n\nUsage\n=====\n\n### PLC Configuration\n\nThis driver uses Modbus TCP/IP for communication. Unlike the ClickPLC, modbus\naddresses need to be manually configured in the Productivity PLC firmware (see\n[manual](https://cdn.automationdirect.com/static/manuals/p2userm/p2userm.pdf)).\n\nTo use this driver, go to `Write Program \u2192 Tag Database`, scroll down to the values\nyou care about, and double click the `Mod Start` cell of each value to assign an address.\nThen, go to `File \u2192 Export \u2192 Tags` to export a csv file. The file is used here so\nyou don't need to remember the addresses.\n\n### Command Line\n\nTo print the tags and their values, simply call the library with the PLC IP address and the tags file.\n```\n$ productivity the-plc-ip-address path/to/tags.csv\n```\n\nUse --set to set values on the PLC:\n```\n$ productivity the-plc-ip-address path/to/tags.csv -s \"{int_test: 4, float_test: 4.45, string_test: foo}\"\n```\nThe --set parameter takes [YAML](https://learnxinyminutes.com/docs/yaml/), a simple data format that allows you to easily set multiple tags at once.\n\nSee `productivity --help` for more.\n\n### Python\n\nThis driver uses Python \u22653.5's async/await syntax to asynchronously communicate with\na Productivity2000 PLC. For example (note that asyncio.run() requires Python >=3.7):\n\n```python\nimport asyncio\nfrom productivity import ProductivityPLC\n\nasync def run():\n async with ProductivityPLC('the-plc-ip-address', 'path/to/tags.csv') as plc:\n print(await plc.get())\n\nasyncio.run(run())\n```\n\nIt is also possible to set tag values:\n```python\nasync def run():\n async with ProductivityPLC('the-plc-ip-address', 'path/to/tags.csv') as plc:\n await plc.set(start=True, setpoint=1.1)\n\nasyncio.run(run())\n```\n",
"bugtrack_url": null,
"license": "GPLv2",
"summary": "Python driver for AutomationDirect Productivity Series PLCs.",
"version": "0.11.1",
"project_urls": {
"Homepage": "https://github.com/numat/productivity/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b73cc72682c6771bf6d8d47874b0480000ec4c12b21b69d6193be0928a02ddc0",
"md5": "27c2edb1f6251dd89326b17876ff1a78",
"sha256": "98f72b2c10c85f2b5cffb11464542139564c8a1a06e4e89d42049eef516dcbff"
},
"downloads": -1,
"filename": "productivity-0.11.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "27c2edb1f6251dd89326b17876ff1a78",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 18687,
"upload_time": "2023-12-08T18:21:52",
"upload_time_iso_8601": "2023-12-08T18:21:52.938789Z",
"url": "https://files.pythonhosted.org/packages/b7/3c/c72682c6771bf6d8d47874b0480000ec4c12b21b69d6193be0928a02ddc0/productivity-0.11.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "890351dbb4e32109698806bbb45265dafb6e44c0544e5b7877994b1b4217e433",
"md5": "9be795524747e70c8af75c1bfa4a6c66",
"sha256": "5556e67bf6a076a306896697886901517536e9f23f1f435e7d36caf03fa6ce87"
},
"downloads": -1,
"filename": "productivity-0.11.1.tar.gz",
"has_sig": false,
"md5_digest": "9be795524747e70c8af75c1bfa4a6c66",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 20503,
"upload_time": "2023-12-08T18:21:55",
"upload_time_iso_8601": "2023-12-08T18:21:55.354585Z",
"url": "https://files.pythonhosted.org/packages/89/03/51dbb4e32109698806bbb45265dafb6e44c0544e5b7877994b1b4217e433/productivity-0.11.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-08 18:21:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "numat",
"github_project": "productivity",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "productivity"
}