Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital output NI-MAX tasks always reads low

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?

0 Kudos
Message 1 of 5
(3,166 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(3,156 Views)

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.

0 Kudos
Message 3 of 5
(3,153 Views)

So yes I had it backwards in my original post, that was a typo. The same issue still applies.

0 Kudos
Message 4 of 5
(3,134 Views)

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.

William R.
0 Kudos
Message 5 of 5
(3,129 Views)