Skip to main content

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


Download files

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

Source Distribution

controlpyweb-0.0.15.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

controlpyweb-0.0.15-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file controlpyweb-0.0.15.tar.gz.

File metadata

  • Download URL: controlpyweb-0.0.15.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

File hashes

Hashes for controlpyweb-0.0.15.tar.gz
Algorithm Hash digest
SHA256 374c6aa575d75b541493e6d974f8ebaccfb6c791db90269ba771a869011ebc44
MD5 fc9fd0836e5a351839088284270d6ca9
BLAKE2b-256 712a780b6c926402acefaf8611dac8f62c01c2e8d0d466ede5c9fef52a8fb266

See more details on using hashes here.

File details

Details for the file controlpyweb-0.0.15-py3-none-any.whl.

File metadata

  • Download URL: controlpyweb-0.0.15-py3-none-any.whl
  • Upload date:
  • Size: 9.5 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/39.1.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

File hashes

Hashes for controlpyweb-0.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 797393d263e912ef0316243acc82d0a4110c32dad233e1144c5f5004554ae849
MD5 c789dced948704d5f02c5225f5fc9e7a
BLAKE2b-256 41902e6d8eb85c84146f24b7c36158e9f121139c6b19ac240728bddc1ca01bda

See more details on using hashes here.

Supported by

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