Git Product home page Git Product logo

crevisio's Introduction

Control Crevis Modbus I/O Adapters using Python

Python module that lets you control discrete I/O pins on Modbus adapters from Crevis. E.g. the NA9189.

The module uses the following, possibly very idiosyncratic, terminology:

Term Meaning
Adapter Represents an entire I/O device.
Module Each adapter has 0 or more modules connected to it.
Slot Each module is referenced by its slot number, i.e. distance from the adapter.
Pin The pin number on a module, a slot:pin tuple identifies a specific pin.

To use it:

import crevisio

# Connect to the adapter
io = crevisio.adapter('198.18.122.10')

# Show some info about the adapter
print repr(io)

# Enable module 0, output pin 4
io[0][4] = True

cio

A commandline interface to crevisio.

In a typical setup, you often contact the same I/O, and have fixed equipment connected to the I/O pins. For that reason, cio can read the default address from a configuration file, avoiding the need to specify it at every invocation. The configuration file can also be used to reference individual pins using aliases.

A simple example may look like this:

address: 192.168.0.100

aliases:
  - name: coffee-maker
    slot: 0
    pin:  1
  - name: nuke
    slot: 0
    pin:  4
  - name: door-bell
    slot: 0
    pin:  5

If you install the argcomplete package, cio will be able to autocomplete pin aliases from your configuration file.

cio will load the first file in any of the following paths:

  • ~/.cio.yaml
  • ~/.config/cio.yaml
  • /etc/cio.yaml

That means that if your system administrator has setup cio already, you do not have to do anything. But if you would like to use a different address, or different aliases, you can override the system default settings.

See cio --help for more information on command usage.

crevisio's People

Contributors

cappe987 avatar mikfr avatar troglobit avatar wkz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.