A project to facilitate easy read/write to the ControlByWeb line of Automation/SCADA IO products.
Project description
ControlPyWeb
A project to facilitate easy read/write to the ControlByWeb line of Automation/SCADA IO products.
Description
Xytronic Research makes a handy line of remote IO products useful for home and industrial automation. Interacting with these modules generally requires the use of a url library such as requests, and then requires dissecting the response to be dissected and processed. While not terribly difficult to do, it is repetitive.
This module seeks to abstract out some of that effort in a thought out and tested way.
Installation
pip install controlpyweb
Usage
The basis of functionality is the WebIOModule class. It both acts as a container for individual IO and handles interaction with the hardware.
from controlpyweb.webio_module import WebIOModule
from controlpyweb.single_io import DiscreteIn, DiscreteOut, AnalogIn, AnalogOut
class X404DigitalIn(WebIOModule): # Name the class whatever you like
StartButton = DiscreteIn("Start Button", "startButton")
StopButton = DiscreteIn("Stop Button", "stopButton")
DoorClosed = DiscreteIn("Door Closed", "doorClosed")
class X410DigitalOut(WebIOModule):
StartLamp = DiscreteOut("Start Lapm", "redLamp")
MaintLight = DiscreteOut("Maintenance Lamp", "lamp1")
digital_in = X404DigitalIn("192.168.1.1")
relay_out = X410DigitalOut("192.168.1.2")
digital_in.update_from_module()
relay_out.StartLamp = digital_in.StartButton
relay_out.MaintLight = not digital_in.DoorClosed
relay_out.send_changes_to_module()
Though it is possible to do immediate reads/writes, the most efficient pattern is to first to do an update from the module, make all changes, then send the results.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file controlpyweb-0.0.22.tar.gz
.
File metadata
- Download URL: controlpyweb-0.0.22.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b09d7b3cb29c52ca284d762d4b082350644242b71c7f97f6f8d442a1be39540 |
|
MD5 | 7a901a50e11fb8a7ba79085abcf8d8e0 |
|
BLAKE2b-256 | 6942db1d76d63826c35e013dae417f1fd6119e3c73ac5dcb9bc92a13dd9e9612 |
File details
Details for the file controlpyweb-0.0.22-py3-none-any.whl
.
File metadata
- Download URL: controlpyweb-0.0.22-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 898c2041476a4f56c47d83ed12add353b9ed449259d3af6df544786e36851536 |
|
MD5 | 1125cc0121ad963650e358e5cf7683aa |
|
BLAKE2b-256 | 5afc8c8fd4dfd6f4aaa3dbd86feb15e8e2e4236363f0ebce78eec98fd364c793 |