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

Function to read analog input FIO4 using python in Ubuntu
Started by
jose
, Apr 29 2013 03:18 AM
2 replies to this topic
#1
Posted 29 April 2013 - 03:18 AM
#2
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:
The following are three different ways to read the FIO4/AIN4 analog input voltage:
or
or
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.
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
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