[ANSWERED]: Getting EasyDAQ channel labels

Posted on
Thu Feb 05, 2015 6:01 pm
papamac offline
User avatar
Posts: 131
Joined: Jan 29, 2014

[ANSWERED]: Getting EasyDAQ channel labels

I am writing a python script that requires the state of individual digital inputs on the EasyDaq card. I am able to access the states by channel number as follows:

states = dict(indigo.devices['easydaq'].states)
dnstMotion = states['channel17']

I would like, however, to access the state info using the symbolic label that I assigned to each channel in the EasyDAQ device setup. I could not find the mapping from symbolic label to channel number anywhere in the easydaq object. Is this private information? Do you know of any way to access it?

I can, of course, maintain a dictionary of symbolic names and channel numbers in my code, but this is unsatisfactory as it can potentially get out of sync with the EasyDAQ device setup.

Thanks,

David

David A. Krause
krause@acm.org
303-517-8830

Posted on
Sat Feb 07, 2015 10:54 am
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Getting EasyDAQ state information from a symbolic refere

Hi David,

You can dump the entire device object to the Indigo Event Log window like this:

Code: Select all
dev = indigo.devices['easydaq']
indigo.server.log(unicode(dev))

From there with a bit of sleuthing you'll see you can access the labels like this:

Code: Select all
pluginId = 'com.perceptiveautomation.indigoplugin.easydaq-usb-relay-cards'
dev = indigo.devices['easydaq']
dev.globalProps[pluginId]['channel01.label']

Image

Posted on
Mon Feb 09, 2015 8:19 pm
papamac offline
User avatar
Posts: 131
Joined: Jan 29, 2014

Re: [ANSWERED]: Getting EasyDAQ channel labels

Thanks Matt... this worked great and I learned a lot about sleuthing objects.
You rock!

David

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests