U12 output not holding | LabJack
 

U12 output not holding

2 posts / 0 new
Last post
Darryl
dmasson's picture
U12 output not holding

I'm trying to use a U12 to control a relay (this, however, is incidental). I have one digital output line to set the relay status (IO2) and one digital input line that monitors the relay status (IO3). The problem is that as soon as I do a read command on IO3, the output from IO2 is driven low. Even if nothing is connected to the U12 terminals, if I set IO2 to high and do two reads on IO3, the first is high and the second is low. If I set IO2 to low and do two reads on IO3, the first is high and the second is low. Reads on analog channels does not appear to have any influence. It seems that reading on IO3 resets the state of IO2, because if I do nothing the state of IO2 stays high. Is this a known problem, or am I in uncharted waters?

(Ubuntu 18.04, python 3.6, v2.0.0 driver)

LabJack Support
LabJack Support's picture
If you need to maintain

If you need to maintain multiple digital I/O states with LabJackPython, currently there are two options:

1. Use rawDIO instead for the IO lines, and set them all to the desired input/output states.

2. Use the D lines instead.

The reasoning for above is that for IOs, both the state and direction need to be set, but only the IO state can be read from the device. Since the direction cannot be read to maintain directions, eDigitalIn defaults all IO lines to inputs and eDigitalOut defaults other lines (not channel) to digital output-low. The D lines can maintain both their direction and states, so it is not an issues with the e functions. Note that this only applies to LabJackPython on Linux and Mac, and the Windows high-level driver which LabJackPythyon uses on Windows maintains states through software with the last known settings.