Skip to main content

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()
Immediate reads/writes are supported
relay_out.StartLamp.write_immediate(True)  
is_started = digital_in.read_immediate()

(However, immediate reads/writes are costly from a resource perspective and should be avoided.)

Overrides are common for typical operations
if discrete_in.StartButton and discrete_in.DoorClosed:
    discrete_out.StartMachine = True

Metadata

Release files for controlpyweb 0.1.0

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

Source distribution (sdist)

Source distribution for controlpyweb 0.1.0
File Size Uploaded
controlpyweb-0.1.0.tar.gz 8.4 kB Details

Built distribution (wheel)

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

Total release size: 24.8 kB

Release files / controlpyweb-0.1.0.tar.gz

Download URL controlpyweb-0.1.0.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
45b0956cc85d4dff31f616a8479b7ae4fff82167041086b6182d1b95363d83d2
BLAKE2b-256 checksum
How to use checksums
f98947bab5aa11c0892f819953eda705ec834b449dacc48bdf66fd664952218d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release files / controlpyweb-0.1.0-py3-none-any.whl

Download URL controlpyweb-0.1.0-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52f5b75b2dfa9e545a95f35d07348785c1e0bb3023b4edb021fc60451e52dbf5
BLAKE2b-256 checksum
How to use checksums
fb000f3bc25fdcafcfdaa1299831dbafe9e877a96315a4211e6cba22c3e73c57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.33

2 release files

0.0.32

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

3 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

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