From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with back-to-back digital outputs to 6008

We're using a USB 6008 with DAQmx 8.0 in a .NET 1.1 app on WinXP Pro SP2
 
We use WriteSingleSampleSingleLine to lower a digital output line and then raise it again about 5ms later.
 
It appears that intermittently the line doesn't go low (we've verified this with an external 'scope).   It's almost like the 6008 either doesn't get the "set low" write, or gets both writes (set low+set high) in such rapid succession that the "set high" write overlays/replaces the "set low". 
 
Is a DAQmx Write command "synchronous" (the calling app is blocked until the value has actually been written to the 6008) OR is it "async" (the calling app is NOT blocked while the value is written to the 6008)?
 
To debug the problem, we inserted a Read command to read-back the value just written to the 6008 line, and the problem disappears... the value always seems to get written to the 6008... which makes it very suspicious that the write command is somehow being "buffered" and not written to the 6008 until some other operation (like Read) is performed. 
 
Has anyone else seen a similar problem with back-to-back digital outputs to a 6008 or other NI device... particularly one that's USB?
 
DT
 
 
0 Kudos
Message 1 of 2
(3,107 Views)

DT,

I modified one of the example programs to do two digital writes, each using WriteSingleSampleSingleLine, separated by a delay of 5 ms.  For the delay, I used System.Threading.Thread.Sleep(5), but there may be a better way to do this.  I have tested the attached code and verified that it creates a pulse of at least 5 ms.  Please try running this code and let me know if it works.  If so, how does your code differ from this example?

Regards,

0 Kudos
Message 2 of 2
(3,090 Views)