This is probably an easy question, but I haven't found an answer so far. What Python command do I use to read a differential voltable between AIN0 and AIN1 with AIN0 being the high side. AIN1 goes to 24 VDC ground, and there is a 250 ohm resistor between the two terminals. The signal is 4-20 ma. So I should be getting 1-5 VDC.
Is this a U6?
If you have 24V ground tied to LabJack GND you could do a single-ended measurement since one side of the resistor is at ground.
I have a U3-HV. I'm testing the functioning of an Allen-Bradley analog input module in the measurement of signals from a pressure transducer by putting the U3 in place of the A-B module. I wired up the U3 as close as possible to how the A-B module is wired, which is why I didn't want to take the ground through the U3. The U3 ground is probably already tied to the 24 VDC ground as the Raspberry Pi that the U3 is connected to is powered by the 24 VDC power supply that powers the pressure transducer, although specifically the Pi is directly powered by a Drok step down regulator, with the regulator connected to the 24 VDC power supply.
I notice is the U3 user guide from 2009, there is a command LJ_ioGET_AIN_DIFF. Would that translate in Python to
getAINdiff(0,1?)?
There is no getAINdiff method. The getAIN can be used to get a differential reading. The method and its parameters are:
getAIN(posChannel, negChannel=31, longSettle=False, quickSample=False)
getAIN(0, 1) is a AIN0-AIN1 differential reading. Similar if you are using Feedback with the AIN IOType, there are PositiveChannel and NegativeChannel settings/parameters.
Positive and negative channels are discussed further in the U3 datasheet:
https://labjack.com/support/datasheets/u3/hardware-description/ain/chann...
I tried the getAIN(0, 1) and got a response that the HV channels can't be used for differentials.
I tried:
d.getFeedback(u3.AIN(PositiveChannel = 0, NegativeChannel=1, LongSettling=False, QuickSample=False))
then did getAIN(0) and got a response a little different from:
d.getFeedback(u3.AIN(PositiveChannel = 0, NegativeChannel=31, LongSettling=False, QuickSample=False))
getAIN(0).
Differential on the high voltage analog inputs on a U3-HV is lightly supported. You will get uncalibrated binary values that you have to convert to scaled values as you see fit. See the 5th paragraph:
https://labjack.com/support/datasheets/u3/hardware-description/ain
I'll have someone else follow up on how to do that in Python if it is possible.
Perhaps use a low voltage analog input instead as they do support differential. If your voltage fits in their range, you get better resolution also.
The U3 ground is probably already tied to the 24 VDC ground as the Raspberry Pi that the U3 is connected to is powered by the 24 VDC power supply that powers the pressure transducer, although specifically the Pi is directly powered by a Drok step down regulator, with the regulator connected to the 24 VDC power supply.
Note that differential readings can't be totally floating, so you do need a common reference of some sort:
https://labjack.com/support/app-notes/differential-analog-inputs
If the negative/ground is the same on input and output of your step-down then it sounds like you are in good shape, but if your step-down is isolated then it sounds like you are floating.
I followed you first guidance and attached the low side of the resistor to GND and the GND to the low side of the 24 VDC power supply. Readings look normal. If I need to do a differential, I'll use a smaller resistor and the low side terminals. Anyway, I learned some more about the U3 and Python from this. Thanks for your help.
Following up on:
Differential on the high voltage analog inputs on a U3-HV is lightly supported. You will get uncalibrated binary values that you have to convert to scaled values as you see fit. See the 5th paragraph:
https://labjack.com/support/datasheets/u3/hardware-description/ain
I'll have someone else follow up on how to do that in Python if it is possible.
The getFeedback call with the AIN IOType performs an uncalibrated binary reading (0-65535 value) and can do differential on the HV lines. This call is doing a binary differential AIN0-AIN1 reading:
d.getFeedback(u3.AIN(PositiveChannel = 0, NegativeChannel=1, LongSettling=False, QuickSample=False))
And this is doing a binary single-ended AIN0 reading:
d.getFeedback(u3.AIN(PositiveChannel = 0, NegativeChannel=31, LongSettling=False, QuickSample=False))