Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to perform continuous sampling with DAQmx using threads?
NazRB last edited by
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.
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?
How is that related to Qt ?
Your question is about how to use DAQmx, so your best bet is to