Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx start and read vi's sets bits low before actually reading

Solved!
Go to solution

I am using DAQmx write to set bits on a 9403 card. When I set a bit high, then try to read that bit in a subseqeuent vi that bit gets set low! Both DAQmx Start and DAQmx Read vis seem to reset the bit low. How is that supposed to happen? I was certain bits would not be reset low unless the device itself was reset.

PaulG.

LabVIEW versions 5.0 - 2023

“All programmers are optimists”
― Frederick P. Brooks Jr.
0 Kudos
Message 1 of 3
(3,247 Views)
Solution
Accepted by topic author PaulG.

I'm guessing you're creating a digital output channel, calling start, write, and then creating a separate digital input channel, and calling start->read or read.

 

Creating the input channel changes the direction of the line.  This happens at commit (which you go through when calling start, or read with no start).  Once the direction changes, you are no longer driving the line.  That's why you are always reading zero.

 

You have two options.  You can either call read after write (in the digital output task) or you can mess around with the tristate property.  Tristate is a DAQmx channel property (DigitalOutput->Tristate).  The help for it is pretty good.

 

Both ways will let you read the value of the line without changing the current line state.

Message 2 of 3
(3,234 Views)
Thanks, Mark. I already figured out how to get it to work with the tristate property.
PaulG.

LabVIEW versions 5.0 - 2023

“All programmers are optimists”
― Frederick P. Brooks Jr.
0 Kudos
Message 3 of 3
(3,227 Views)