How to perform continuous sampling with DAQmx using threads?
-
wrote on 17 Jul 2014, 19:39 last edited by
Background:
I need to continuously sample a signal at 10MHz and display each 1024*1024 chunks of data as an image. I use NI DAQmx to collect data and NI Vision to display the data on the screen, all through the QT Creator.
The raw data is supplied from NI PCI-6259 in uInt32 format. So, after reading a chunk of data, I have to downcast it to uInt16 before displaying. Reading, downcasting and displaying the data takes long enough to miss samples.Problem:
How can I implement the script to read the data continuously? I was thinking about threads, but I do not have enough knowledge to even know if this approach could work. I think that DAQmx Task must be the same (and only one) for all of the threads. Thus, if I understand correctly, I can not call the TASK in two threads simultaneously.If someone could give me an insight on how this could be done, I would appreciate it. Perhaps, a pseudo-code, so I could get the concept behind this approach? Any other suggestions on how the sampling could be implemented?
-
Hi,
How is that related to Qt ?
-
Hi,
Your question is about how to use DAQmx, so your best bet is to
- Consult the DAQmx documentation: http://www.ni.com/white-paper/2931/en/ , and
- Go to the NI forums to ask for help on using DAQmx functions: http://forums.ni.com/
1/3