Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Photo

analog voltages on U12

U12 eAnalogIn

  • Please log in to reply
2 replies to this topic

#1 DaveBlom

DaveBlom
  • Members
  • 2 posts

Posted 06 December 2013 - 08:42 AM

Hi there,

 

Am just starting to get to grips with Python and my question is :- Does eAnalogIn return anything else apart from the string. Have got the code below but was expecting a floating variable with the voltage in it as per VB etc.

 

while a == 1:
 import time
 time.sleep (0.9)
 import u12
 d = u12.U12()
 Voltage = d.eAnalogIn(channel=0, gain=0)
 
 print Voltage
 

 

Cheers

 

Dave

 

 



#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 06 December 2013 - 11:57 AM

In Python, eAnalogIn returns a dictionary containing the overVoltage, idnum, and voltage. To get the voltage only it would look like:

 

Voltage = d.eAnalogIn(channel=0, gain=0)['voltage']



#3 DaveBlom

DaveBlom
  • Members
  • 2 posts

Posted 06 December 2013 - 01:22 PM

Ah, nice one. Thanks for that.

 

Cheers

 

Dave





Also tagged with one or more of these keywords: U12, eAnalogIn

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users