Skip to main content

A modern Python Framework for microboard automation and control applications development

Project description

rackio-framework

A modern Python Framework for microboard automation and control applications development. Github-Rackio Framework

Requirements

Python 3.6+

Installation

pip install Rackio

Examples

Basic Setup

from rackio import Rackio, TagEngine
from rackio.models import Tag

app = Rackio()
tag_egine = TagEngine()

# Tags definitions

tag_egine.set_tag("RAND1", "float")
tag_egine.set_tag("RAND2", "float")
tag_egine.set_tag("T1", "float")
tag_egine.set_tag("T2", "float")
tag_egine.set_tag("T3", "float")

if __name__ == "__main__":

    app.run()

Rackio comes with some built-in features that let you start creating rapid and fast coding prototypes.

Adding some controls

# Conditions definitions

cond1 = Condition("T1",">=", "T2")
cond2 = Condition("T1","<", "T2")

# Actions definitions

act1 = Action("T3", 40)
act2 = Action("T3", 80)

# Controls Definitions

control1 = Control("C1", cond1, act1)
control2 = Control("C2", cond2, act2)

app.append_control(control1)
app.append_control(control2)

Once Rackio is up and running, will trigger some actions if the associated condtions are met, by observing continously all the tags values for changes.

Adding some continous tasks

Rackio can be extended to add custom continous tasks and operations

@app.rackit(1)
def writer1():

    tag_egine.write_tag("T1", 15)
    tag_egine.write_tag("T2", 40)

    direction = 1

    while True:

        time.sleep(0.5)

        value = 24 + 2 * random()
        tag_egine.write_tag("RAND1", value)

        T1 = tag_egine.read_tag("T1")
        T1 += direction

        tag_egine.write_tag("T1", T1)

        if T1 >= 60:
            direction *= -1

        if T1 <= 5:
            direction *= -1

You can register a defined function as a continous task to be perform by Rackio. You can also provide functions as tasks lists

@app.rackit_on(period=1)
def reader():

    rand1 = tag_egine.read_tag("RAND1")
    rand2 = tag_egine.read_tag("RAND2")
    T1 = tag_egine.read_tag("T1")
    T2 = tag_egine.read_tag("T2")
    T3 = tag_egine.read_tag("T3")

    print("")
    print("RAND1: {}".format(rand1))
    print("RAND2: {}".format(rand2))
    print("T1   : {}".format(T1))
    print("T2   : {}".format(T2))
    print("T3   : {}".format(T3))

By specify its period, you can keep control of the time execution for these tasks.

Things to do

Rackio is work in progress framework, some features are still in development and they will be release soon for better applications, these features are listed below:

  • RESTFul API
  • Web Based Monitoring and Admin
  • Alarms definitions
  • Modbus and MQTT protocols
  • Automatic Datalogging
  • Trends and Historical data
  • Math evaluations in actions objects

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

Rackio-0.0.7-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file Rackio-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: Rackio-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.1

File hashes

Hashes for Rackio-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 ee93455ed0aa1e9437e4fda418fafa3921a894e081297cc4178516075f05a479
MD5 3f6ab6106fbc29fd8ccd42513949863c
BLAKE2b-256 8a3d480e61b103545f751375c34ef53b2c421235fe2b7b3b0c2649b3fb525fa3

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