From 8ec5fd64a29a7189c581ac620c3a0028a8dd396c Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Sun, 3 Apr 2022 22:23:03 -0400 Subject: updates for labjack_ue9 --- qolab/hardware/daq/labjack_ue9.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'qolab/hardware/daq/labjack_ue9.py') diff --git a/qolab/hardware/daq/labjack_ue9.py b/qolab/hardware/daq/labjack_ue9.py index 5b293f4..a467746 100644 --- a/qolab/hardware/daq/labjack_ue9.py +++ b/qolab/hardware/daq/labjack_ue9.py @@ -17,8 +17,8 @@ class LabJackUE9(DAQ): self.AnalogInputsNum=4 self.AnalogOutputsNum=2 - # self.daq = ue9.UE9(debug=debug, autoOpen=autoOpen, ethernet=ethernet, ipAddress=ipAddress) - self.daq = ue9.UE9(debug=debug, autoOpen=autoOpen) + self.daq = ue9.UE9(debug=debug, autoOpen=autoOpen, ethernet=ethernet, ipAddress=ipAddress) + # self.daq = ue9.UE9(debug=debug, autoOpen=autoOpen) # For applying the proper calibration to readings. c=self.daq.getCalibrationData() @@ -27,17 +27,21 @@ class LabJackUE9(DAQ): # fixing missing slope for gain '0' c['AINSlopes']['0']= 0.0000775030 - def getChanVoltage(self, chNum, BipGain): + def getAIN(self, chNum): + """ get analog input (AIN) voltage """ BipGain = 8 + Resolution = 12 + SettlingTime = 0 # BipGain = 8 -> bipolar range (-5V, +5V) gain 1 # UE9 default BipGain = 0 -> signal range (0V, +5V) gain 1 # other BipGain could be: # 0 = Unipolar Gain 1, 1 = Unipolar Gain 2, # 2 = Unipolar Gain 4, 3 = Unipolar Gain 8, # 8 = Bipolar Gain 1 - return self.daq.getAIN(chNum, BipGain = BipGain) + return self.daq.getAIN(chNum, BipGain = BipGain, Resolution = Resolution, SettlingTime = SettlingTime) - def setChanVoltage(self, chNum, volts): + def setDAC(self, chNum, volts): + """ set digital to analog (DAC) output voltage """ if chNum == None or volts == None: print("setOutputCh needs chNum and volts to be set") return 0 -- cgit v1.2.3