How do I know when the buffer flushed all the data out?

I am using a very high sampling rate (500000 Hz) and acquire 1024 data points continuously.   It takes 370000 data points in 10 second.   I use a counter to help with the retrigger PFI line.   I have a huge buffer so that I can make sure that the buffer is not overflowed.  The code is attached below.  My problem is that the data acquisition is done so fast (in 10 seconds)  but the processing of the data is not.  In :nEvent, I basically save and plot the data.  The saving process is not slow.   However, our videocard is so SSSSLOOOW and can not keep up with realtime data display.    After the user is done collecting the data, they do not want to wait for the screen to plot the data from the buffer.   So after the data collection is done, I basically stop the plotting process but we still need to flush the data out from the buffer for saving.  My question is that how can I tell when the buffer is empty.
Thanks,
Yajai
m_task = std::auto_ptr<CNiDAQmxTask>(new CNiDAQmxTask("aiTask"));
m_counter = std::auto_ptr<CNiDAQmxTask>(new CNiDAQmxTask("coTask"));
m_task->Stream.Timeout = -1;
//Create a channel
m_task->AIChannels.CreateVoltageChannel(physicalChannel, "",
static_cast<DAQmxAITerminalConfiguration>(DAQmxAITerminalConfigurationRse), minimum, maximum,
DAQmxAIVoltageUnitsVolts);
m_task->Timing.ConfigureSampleClock(counterSource, sampleRate,DAQmxSampleClockActiveEdgeRising,DAQmxSampleQuantityModeContinuousSamples, samplesPerChannel);
m_task->Stream.Buffer.InputBufferSize = samplesPerChannel * 2000;
m_counter->COChannels.CreatePulseChannelFrequency(counterChannel, "coChannel", DAQmxCOPulseFrequencyUnitsHertz, DAQmxCOPulseIdleStateLow, 0, sampleRate, 0.5);
m_counter->Timing.ConfigureImplicit(DAQmxSampleQuantityModeFiniteSamples, samplesPerChannel);
m_task->Control(DAQmxTaskVerify);
m_counter->Control(DAQmxTaskVerify);
m_counter->Triggers.StartTrigger.ConfigureDigitalEdgeTrigger(
referenceTriggerSource, DAQmxDigitalEdgeStartTriggerEdgeRising);
m_counter->Triggers.StartTrigger.Retriggerable = true;
m_taskRunning = true;
m_counter->Start();
// Set up the graph
m_Graph.Plots.RemoveAll();
for (unsigned int i = 0; i < m_task->AIChannels.Count; i++)
m_Graph.Plots.Add();
m_Graph.Plots.Item(i+1).LineColor = m_colors[i % 8];
// Create Multi-channel Reader
m_reader = std::auto_ptr<CNiDAQmxAnalogMultiChannelReader>(new CNiDAQmxAnalogMultiChannelReader(m_task->Stream));
m_reader->InstallEventHandler(*this, OnEvent);
m_reader->ReadMultiSampleAsync(samplesPerChannel, m_data);

Yajai,
I'm a little confused about your acquisiton. Do you intend for it to be
finite, or continuous? I'm also unclear about your rates. You state
that you are acquiring 1024 samples at 500kHz, yet you get only 370k
samples in 10 seconds. Are you periodically acquiring 1024 samples at
500kHz?  Do you do any reads other than the final m_reader->ReadMultiSampleAsync(samplesPerChannel, m_data)? Could you provide the code where you stop the plotting process?
Thanks,
Ryan V.
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments

Similar Messages

  • My iphone has been stolen so i went to icloud and did the remote wipe/erase. but it says offline pending erase. how will i know when my pictures and all other data have been erased?

    help
       my iphone has been stolen i did the auto erase online but my phone is offline pending erase i cant bare to think someone has acces to my phots and pictures. how will i know when the erase has been succesful

    Thank you again for all of your help!! I really appreciate it!
    I think I am following -- I was able to upload to my iPhoto and all photos and videos are there that is a plus! I tried to create an Event in my iPhoto and put all of my photos in that event but for some reason, now my iTunes it not recognizing that Event in my iPhoto. It is not allowing me to import just that event at the moment but I may be doing something wrong. At least all of my pics and vids are in iPhoto so that is a plus and I know they are at least saved somewhere. Just for some reason, my iTunes it not locating the event that I created with only those photos.
    Thank you for letting me know about my contacts! How do I know if I have the contacts app?
    Also, I had no clue that my iCloud could be backed up via cellular data! However, is this a new feature with the most updated iOS?? Unforutnatly I am like 2 iOS updates behind because I don't have enough storage on my phone. I still get the notification that my phone needs to be plugged in and connected to wifi in order to back up to the cloud :-(
    How can I sync using USB? Right now when i click on the info tab for my iPhone in my iTunes this is the answer that I get -- I am a little unclear as to what it means.
    Sync Contacts:
    Your contacts are being synced with you iPhone over the air from iCloud. Over-the-air sync settings can be changed on you iPhone
    Sync Calendars:
    Your calendars are being synced with you iPhone over the air from iCloud. Over-the-air sync settings can be changed on you iPhone

  • HT1459 My I pod is not responding  how do I know when the ipod had actually died?????

    my ipod has the green lights however when i try to listen to music ....nothing ....i tried several head sets. how do i know when the ipod is finally dead

    Read the manual for a solution - iPod Manuals

  • How do we know, when the service contract is last modified ?

    How do we know, when the service contract is last modified and by whom ?
    thanks
    siva
    Edited by: sivapara on Nov 24, 2008 3:14 PM

    To add also in OKC_K_HISTORY_B for some actions.
    Thanks
    Nagamohan

  • How do you know when the music is synced to an ipod classic? I don't see it showing it in the window.

    how do you know when the music is synced to the ipod?the lod version would show it syncing in the window at the top of the screen this version doesn't.

    If you have access to a Mac couldn't you receive your verification via iMessage and work to view you iCloud Account?

  • How to get group when the data source from system instead of UME database

    Hig guys,
    How to get group when the data source comes from backend system instead of UME database?
    I tried to use
    IUMPrincipal RefGroup = WPUMFactory.getGroupFactory().getGroup(groupName);
    But I was not able to get the group. But in "UserAdministrator", I can find this groupName.
    Which kind of API can I use?
    Thanks in advance!
    Regards,
    Liying
    Message was edited by:
            Liying Wang

    Ok,
    try this:
    com.sapportals.portal.security.usermanagement.IGroupFactory ep5GroupFactory = userManagementService.getGroupFactory();
    IGroupFactory groupFactory = UMFactory.getGroupFactory();
    com.sap.security.api.IGroup group = groupFactory.getGroupByUniqueName(groupName);
    IUMPrincipal ep5Principal = ep5GroupFactory.getEP5Group(group);
    This should do the trick,
    Romano
    PS: and thanks for the stars!

  • How Do You Know When The Zen Touch Is Done Chargi

    I searched through the forums and couldn't find anything on this topic.
    I want to make sure that I don't overcharge my player, while still filling it to its enormous capacity. How will I know when it's done charging?

    On my touch there is a little icon in the upper left corner of the screen showing my battery symbol with a power volt thing over it to show it is charging. This changes back and forth until the charging is done, then there is nothing on the screen at all.
    -mrspike

  • HT1498 How do I know when the rented movie is downloaded

    I will be flying across seas and I want to download several rentals but how do I know when they are download completely to my iPad so once I'm up in the air I can watch them without being connect to the internet.

    There are many ways, such as a gray screen on startup, kernal panics, very slow startup times, etc. These items alone don't always point to a failing HD but are symtoms, also if you hear the HD making a lot of noise, that is a pretty sure sign.
    If you suspect  yours is failing it  would be helpful to tell us the symptoms you are experiencing.
    One thing you can test for is Disk Utilities S.M.A.R.T. status of the HD, if it says anything but Verified then it's failing. However that test alone should be taken with a grain of salt, because a drive can be Verified but still failing.
    If you have ANY doubts about yours, Backup IMMEDIATELY and take the computer to your local Genius Bar or AASP to be tested.

  • How make to know when the attachment file display its visible or hidden

    Hi guys,
    sorry for my english.
    In my scenario I have two button for open or close the attachment file display with the script 'app.execMenuItem("ShowHideFileAttachment");'.
    But i don't know when the attachment file display its visible or hidden or detect when the user clicks on show/hidden in the display.
    Anybody knows?
    Thanks in advance.
    ZAMPAZAMPA.

    Thanks radzmar,
    You help me a lot, but how i make to ask to pdf is it panel of attachment its open?
    I make this:
    event.target.viewState == {overViewMode:7}
    but return false all the time when panel of attachment its open and when its close.
    ZAMPAZAMPA.

  • My film has not totally downloaded, I did not realise this until it stopped 15 minutes before the end, how do I know when the rented film I have purchased has been fully downloaded. Can I retrieve anyhow

    My film I rented has not fully downloaded I only realised that when it stopped 15 minutes before the end , how do I know when a film has been fully downloaded. Oi would not have thought the film would not have started unless the film was fully downloaded. The film warned me prior to tarting that I only had 48 hours to watch once starting!

    I'm sorry but this is too funny to pass up. 

  • JPopupMenu : how can I know when the mouse leaves the popup?

    Hello,
    I need to know when the mouse leaves a JPopupMenu or more precisely when no items are overlighted. Adding a mouselistener to the popup does not work because the JMenuItems themselves capture the mouse.

    Actually, I added a MouseListener that extends MouseAdapter to the component that owns the popup, and the same MouseListner to the popup itself. I have only overriden the MouseEntered method to let me know that the mouse is no more over a JMenuItem. It's now working fine, but I don't like that kind of programming.....
    I need that to do a toggleButton with a popup menu that would remember the last item selected when the mouse leaves the popup. (Because once a choice is made, the selected "tool" appears as an icon in the button and that icon is updated when the items of the popup are overlighted. So that when the mouse leaves the popup, the selected tool has to reappear as an icon in the button and the associated item has to be armed.)

  • How can I know when the laptop was last used?

    I left my laptop at the office, which is also my parents' house over the weekend. How can I know if someone else had used it while I was gone? Is there a log somewhere I can read or check?

    Console.app and check your browser(s) history. 

  • How do you know when the person that you've shared the file with has downloaded the file?

    After the person get the email that says "I am sharing these files with you.   Click on the image below to view or download your file.", how do you know that they've viewed or downloaded the file?  Do you get an email message or is there something in the shared status that lets you know?

    Thank you for your post. Although this is a feature for Buzzword, right now it's not possible to know if someone has viewed a file you've sent via Share. We are working to integrate Share/My Files/Buzzword so that this will be corrected in future.
    Let me know if you have additional questions.
    Michelle

  • How do i know when the 30 days is over?

    We got the Cloud through work and only want it for a couple computers after the first 30 days. How can I check on the status of where we are at within the 30 days?

    Hi chrisrenn ,
    As you launch the software it will show you remaining days left for trial.
    Regards,
    Romit Sinha

  • How do you know what the data usage was for and why?  It shows you date and usage but not the reason.

    How can you see what data usage was for on the bill?  It only shows the date and usage but not the reason for the usage.

    You can not see this info on VZW's site. There are apps for smartphones that will break down the info though, but by site or what was downloaded

Maybe you are looking for

  • Ipod not being recognized by itunes--was a few weeks ago--have not done 1.1

    hi. i have not installed the 1.10.2006 update as i've seen lots of people have problems with that on these boards. however, today when i tried to sync my ipod, the usb port did not recognize it was there and itunes was not automatically pulled up. so

  • When I visit certain sites the links are broken, only with FF. Switch to IE Tab and they work fine, what do I do?

    Two sites where this happens, that I visit often are mlb.com and woot.com Here are the error messages: From MLB.com - "We are sorry, but you have reached this page in error. Please try the action again and if the problem continues contact Customer Se

  • Sending E-Mail through an Applet

    Hi All, I have been trying to send an E-mail through an Applet but haven't been quite successful. I have tried out a lot of code and even downloaded a few samples but none of them seem to work. I am getting an "Unable to connect to Host exception". R

  • WRT54G Disconnects and REQUIRES a Power on Reset

    My WRT54G disconnects once per day and requires a power on reset to get it back on line. It's version 6 with the most recent firmware. After a wonderful chat session with Linksys this AM and then a subsequent email to Support, I've received NO satisf

  • Forms6i and c# libraries

    Hi there I'd thank any clue to work from Forms6i with libraries written in C#. Doing short the history, we want to pass a card for a optical reader, loading then from the database to Forms6i the information referencing to the card's "key field". FFI