Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

Is NI-DAQ thread safe?

Specifically we want to know what if anything we need to be concerned about with having one thread perform double buffered streaming input while another thread is performing double buffered output?

Has anyone done this on a machine with more than one CPU? If so do you have any advice of any NIDAQ specific issues to be aware of?

Less likely for us but also possible is any concerns with Measurement Studio's NIMath class?

We are using a PCI-4451 running under Windows 2000 Workstation with NI-DAQ 6.9.1f28.

Thanks in advance,
Jack Metcalfe
0 Kudos
Message 1 of 2
(6,610 Views)
Hi Jack,

I have a few threading answers, but nothing very specific on multiprocessors.

The NI-DAQ driver (basically nidaq32.dll) is thread safe. You can read more about it here:
NI-DAQ and Threading

I know customers have used multiprocessor systems with NI-DAQ and it works fine. The trick as far as I know is just to provide the threads and Windows will handle the assignment to processors. I think you can't even make your own assignment of threads to processors.

For our activex controls, we provide no locks around the methods since it would hinder performance on most systems. As of Measurement Studio 6.0, you can access the controls
from multiple threads. Therefore you'll need to add some synchronization of your own around the methods you use.

The data acquisition controls do eventually call the ni-daq dll (which is threadsafe), but everything between your program and the call to the dll will not be exclusive.

I hope this helps. Maybe someone else with more multiprocessor experience will write in to give you hints. If you have any questions about what I said, just comment back and I'll see it.

Thanks,

John N
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(6,610 Views)