Results 1 to 2 of 2

Thread: continuous retrieval of adc data without while loop

  1. #1
    Join Date
    Dec 2011
    Jena, Germany
    Qt products

    Default continuous retrieval of adc data without while loop

    Good evening,

    I am working on a data plotter for an adc (USB-1608FS by Measurement instruments). Everything is working fine when I use a function that allows single readouts:

    Qt Code:
    1. int cbAIn(int BoardNum, int Channel, int Range, unsigned short *DataValue);
    To copy to clipboard, switch view to plain text mode 

    Calling this function regularly with a QTimer allows sampling rates of max. 250 Hz, which is not enough. So I have to use a function that continuously retrieves data in small packages:

    Qt Code:
    1. int cbAInScan(int BoardNum, int LowChan, int HighChan, long Count, long *Rate, int Range, int MemHandle, int Options)
    To copy to clipboard, switch view to plain text mode 

    To update my plot, I query the package index with

    Qt Code:
    1. int cbGetStatus(int BoardNum, int *Status, long *CurCount, long *CurIndex, int FunctionType)
    To copy to clipboard, switch view to plain text mode 

    in a while loop and call addValues(CurIndex) on change.

    The problem: the gui does not stay responsive! I know that the solution to my problems might consist of threading and signals/slots, but I am not sure which function to move to the thread, what is my signal, what my slot and if this is really advantegous compared to my former approach with a while loop.

    Any help would be appreciated!

  2. #2
    Join Date
    Jan 2006
    Warsaw, Poland
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits

    Default Re: continuous retrieval of adc data without while loop

    [wiki]Keeping the GUI Responsive[/wiki]
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.

Similar Threads

  1. Replies: 4
    Last Post: 6th August 2011, 02:40
  2. CONTINUOUS PDF page problem
    By xiangxw in forum Qt Programming
    Replies: 1
    Last Post: 20th July 2011, 13:05
  3. Continuous Printing
    By Prabha in forum General Discussion
    Replies: 0
    Last Post: 28th July 2010, 12:01
  4. Retrieval of frame rate in Phonon.
    By Theo Adams in forum Qt Programming
    Replies: 2
    Last Post: 6th July 2010, 20:00
  5. Replies: 3
    Last Post: 29th April 2010, 20:11

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.