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

Function to read analog input FIO4 using python in Ubuntu


  • Please log in to reply
2 replies to this topic

#1 jose

jose
  • Members
  • 6 posts

Posted 29 April 2013 - 03:18 AM

Hello All,

I am new and I would like to read analog input voltage in FIO4 using python in Ubuntu but I have not found a funtion to do it.
I am able to read AIN0 with the information provided in http://labjack.com/s...t/labjackpython

Can you help me?
Thank you very much,
Jose

#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 29 April 2013 - 10:25 AM

First make sure FIO4 is set as an analog input line. This will set FIO0-4 lines to analog inputs:

d.configIO(FIOAnalog = 31) #AIN0-4 are analog inputs, 5-8 are digital (b00011111)

The following are three different ways to read the FIO4/AIN4 analog input voltage:

ainValue = d.getAIN(4)

or

ain4bits, = d.getFeedback(u3.AIN(4))
ainValue = d.binaryToCalibratedAnalogVoltage(ain4bits, isLowVoltage = True)

or

AIN4_REGISTER = 8 #Note AIN0 = 0, AIN1 = 2, AIN2 = 4, ...
ainValue = d.readRegister(AIN4_REGISTER)

Note that these were derived from the quickstart on the LabJackPython page. For documentation, which provides a list of functions, take a look at the Documentation section on the LabJackPython page.

#3 jose

jose
  • Members
  • 6 posts

Posted 29 April 2013 - 05:17 PM

Thank you very much, I tried before some of these functions using FIO(4) instad AIN(4).


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users