Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Multi-thread, one analog, one digital, one board

I'm working on a PCI-6229 project where I have one thread that handles analog-in and out while the main program thread does some digital I/O but the program is crashing, access-violation errors, on a DAQmxCloseTask command.  I'm pretty sure it is because both threads try to  talk to the 6229 board at the same time, mostly because this seems to occurr at random times, I'm doing analog-in frequently and digital out infrequently, and the crash always occurs in the digital-out routine.

 

I've read here that you can't use multiple threads to do analog I/O on the same board. Is this also the case when one thread does analog and the other digital?

0 Kudos
Message 1 of 3
(3,214 Views)
Even if you are using the same device, AI and DO tasks are  independent and can be started or stopped independently. So there will not be any issues in running these in different threads. Posting you code can help in pin pointing the issue.
------

"A VI inside a Class is worth hundreds in the bush"
യവന്‍ പുലിയാണു കേട്ടാ!!!
0 Kudos
Message 2 of 3
(3,213 Views)

Thanks.

 

I was having trouble tracking down a codeing error and wasn't sure if this was the problem.  Turned out my program would occasioanlly start a second thread that did digital I/O before the previous one was finished.

0 Kudos
Message 3 of 3
(3,184 Views)