Python Script Direct Control

Posted on
Wed Feb 13, 2019 5:21 pm
pacman offline
Posts: 62
Joined: Sep 17, 2008
Location: Pacifica, CA

Python Script Direct Control

I just installed this 8 Channel IO board to replace an EasyDAQ16Net board. The plug-in works great as indicated by the forum thread. It would be nice to change the port (other than 1234) in the plug-in setup as it is modifiable within the board's setup page. I find the inputs easy to use. Indigo senses the change in state timely enough for me.

This replacement looks more stable than the EasyDAQ16Net board, which has always had a problem staying in communication with my Indigo server. I have had two NET DAQ boards in service for a few years and just lived with the inconsistency. DAQ USB Boards are much more stable than the DAQ NET Boards but are limited to distance. Glad to move on! My needs are simple. I want to sense a change in state and send relay outputs. The new board does this well.

If you need to talk directly to the board via python script, here is a way to do it:

# Turn On All
myURL = str("http://admin:yourpassword@board_IP_address/relay_en.cgi?relayonA=on")

import urllib
urllib.urlopen(myURL)
___

# Turn Off All
myURL = str("http://admin:yourpassword@board_IP_address/relay_en.cgi?relayoffA=off")

import urllib
urllib.urlopen(myURL)
___

# Turn On R1 (typical x 8 replays)
myURL = str("http://admin:yourpassword@board_IP_address/relay_en.cgi?relayon1=on")

import urllib
urllib.urlopen(myURL)
___

# Turn Off R1 (typical x 8 replays)
myURL = str("http://admin:yourpassword@board_IP_address/relay_en.cgi?relayoff1=off")

import urllib
urllib.urlopen(myURL)
___

# Pulse R1( typical x8 relays)
myURL = str("http://admin:yourpassword@board_IP_address/relay_en.cgi?pulse1=pulse")

import urllib
urllib.urlopen(myURL)
___

I created separate Indigo Actions for each relay command.

Posted on
Sun Feb 17, 2019 6:35 pm
TwitchCaptain offline
User avatar
Posts: 91
Joined: Dec 13, 2016
Location: San Francisco

Re: Python Script Direct Control

I'll post a release soon allowing the port to be changed. Until recently, the board's firmware didn't allow this, but newer version have been "fixed." Thanks for the feedback and the helpful script!

Posted on
Tue Feb 19, 2019 6:22 pm
agame offline
Posts: 258
Joined: Jul 13, 2017
Location: Melbourne, Australia

Re: Python Script Direct Control

really useful python scripts, thanks.

noting you've provided the script to pulse a relay, the other thing that isn't (I don't think?) exposed in the plugin is setting the pulse length (needs to be done in the board UI). Any chance you could whip up that script?

Posted on
Wed Feb 27, 2019 2:10 am
TwitchCaptain offline
User avatar
Posts: 91
Joined: Dec 13, 2016
Location: San Francisco

Re: Python Script Direct Control

I can probably do that.... I'll take note of it! Thanks!
Noted here: https://github.com/davidnewhall/indigo- ... /issues/10

Posted on
Mon Mar 11, 2019 1:08 am
agame offline
Posts: 258
Joined: Jul 13, 2017
Location: Melbourne, Australia

Re: Python Script Direct Control

:)

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests