ADAM 6050-D REST API Python Wrapper
Likely abandoned. No release or commit for years (last release over 5 years ago).
pip install adam-ioADAM 6050-D REST API Implementation
/ADAM-6050_01_B20190725160245.jpg)
6050-D has 12 digital inputs and 6 digital outputs. It can be controlled with http requests. The aim of this repo is to wrap the ADAM API into a convenience module for Event Gates' deep learning platform VIS.
Installation
pip install adam-io
Usage Examples
You can update output state in three steps;
- Create the ADAM object
- Create/reuse DigitalOutput
- Call ADAM’s output method with DigitalOutput
Read the input state;
- Call ADAM’s input method
Create adam object
IP, username, password of ADAM should be already set from APEX
from adam import ADAM6050D as ADAM
ip='192.168.1.1'
username = 'user'
password = 'pass'
adam = ADAM(ip, username, password)
Construct the digital output object
To change the state of the outputs, you should create/reuse a DigitalOutput object After creating the object, the initial state is empty, so making a request straight away changes nothing.
from digital_io import DigitalOutput
do = DigitalOutput()
# set every available output to 1
do[0]=1
do[1]=1
do[2]=1
do[3]=1
do[4]=1
do[5]=1
You don’t have to set every bit, you can just change the ones you need.
from digital_io import DigitalOutput
do = DigitalOutput()
# set DO0 to 1 and DO5 to 0
do[0]=1
do[5]=0
DigitalOutput accepts an array to set the outputs all at once
from digital_io import DigitalOutput
# set every available output to 1
initial_array = [1,1,1,1,1,1,1]
do = DigitalOutput(array=initial_array)