Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to perform continuous sampling with DAQmx using threads?
Forum Updated to NodeBB v4.3 + New Features

How to perform continuous sampling with DAQmx using threads?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 2.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NazRB
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      How is that related to Qt ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #3

        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/

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved