09-08-2016 08:39 AM
In the system I'm working with, the ports on the USBs are being written to by an application, and I want to read the digital state of the wires at a certain point in time. I'm trying to perform these reads using the digital output tasks provided in NI-MAX. In order to test that the digital output tasks are working as expected, I tried to run a digital input task to write a known bit pattern to the wires, and then run a digital output task to read back the same values afterwards.
The issue is that everytime I run the digital output task, NI-MAX seems to first set all the wires to digital low before reading (thus always reading digital low on every wire). I can tell this because I know how the NI driven device should react to digital low on every wire.
Has anybody encountered this and is there a solution?
09-08-2016 11:33 AM
@ekylNiUser wrote:I tried to run a digital input task to write a known bit pattern to the wires, and then run a digital output task to read back the same values afterwards.
I am pretty sure you have that backwards. You should be writing to a Digital Output task and then reading the data with a Digital Input.
09-08-2016 12:17 PM
What I'm actually doing is writing to the device in NI-MAX by doing Data Neighborhood -> Create New... -> Ni_DAQmx Task -> generate Signals -> Digital output. And reading from the device with Acquire Signals -> Digital Input. I'm fairly sure that this is correct because Digital output is the only one that allows you set the bits, and the device acts as expected when I run that task.
09-09-2016 08:31 AM
So yes I had it backwards in my original post, that was a typo. The same issue still applies.
09-09-2016 11:39 AM
Just to confirm, this is what you're trying to do? http://digital.ni.com/public.nsf/allkb/CB86B3B174763C3E86256FFD007A2511
When you load up an input task, the DAQ device will reconfigure to be externally driven, which would default to read low if nothing is connected due to the way the input circuitry is set up.