Why replay history data from NI-DAQ buffer?

LabVIEW 8.6.1f1, NI-DAQ 8.8, Win Vista, two cDAQ chassis.  (I can't move to LV09 or LV10 for this, not yet anyway).
I have a client with two cDAQ banks, each with 16 TC channels (on 4 modules) and 16 voltage channels (on 1 module), 64 channels all told.
The config operation is like this:
This is called twice, with TC CHANNELS and V CHANNELS describing the channel arrangement.  Both channel descriptors are the same except for device number. The Sample rate works out to 1000 / 100 = 10 Hz. I am using CONTINUOUS SAMPLES, with no need for a buffer, but I understand that one is created anyway.
One loop of my main program is waiting on the READ function:
You can see the explanation of why the loops are there.
After reading the data (at 10 Hz), each frame is sent via UDP to somewhere, and every 5th frame is displayed, via another loop.
This program runs 24/7 on the same computer as another program.
All this works fine in normal circumstances.
However, occasionally, a weirdness creeps in:
In the mornings, after waking the screensaver (or the CPU itself, I'm not sure), we sometimes (not every time) get a very rapid display - the displays are changing much faster than the expected 2 Hz.
I've been wondering whether the data shown was historical, or simply faster updates of live data.
Today, it so happened that a blower was turned on just before waking the computer. The device takes 15 seconds to ramp from zero up to operating pressure normally, and then it stays there.
The readings on screen were frozen (unchanging).  When the computer was awakened, what my client saw was the reading for the blower pressure ramp from zero to running pressure in 2-3 seconds, stay there for 2-3 seconds, drop quickly to zero for 4-5 seconds, and start the ramp again.
Over and over and over it replayed this data, way faster than 2 Hz.  At least 40 times it replayed this same data, while the real pressure was just variations around the operating pressure.  As time went on, instead of dropping to zero, it would drop to some point on the ramp up and repeat from there.  
I don't know if it would eventually straighten itself out - the client gives up and restarts the program.  All is well after that.
I've gone over my code several times, and I can't see a mechanism for me to store this data and re-play it.
Here's my best guess as to what's happening:
Since I am not explicitly setting the buffer size, it defaults to 1000 samples.
Since I'm running at 10 Hz, 1000 samples = 100 sec.
At some point, because of the screensaver, or because of CPU sleepage, or because of integer rollover, or because of zombie infiltration during the night, NI-DAQ has become confused. 
When the mouse was wiggled, the gates were opened. After that, whenever I ask for a sample, it gives me one, without regard to read/write position. It continually gives me the next sample from the buffer and wraps around, again and again, and again, as fast as I can read / process / display.
It is also putting new data into the buffer, so that the historical data eventually gets wiped out.
That fits the facts:
  It shows only recent (last 100 sec) data, not ancient data, and not live data too fast, as I had considered.
  The data changes with time - oldest data gets wiped out.
  It plays the SAME data over and over and over.
But that means a bug in NI-DAQ, I think.  
QUESTIONS:
Any flaws in my thinking?
Any previous sightings of this symptom?
Any ideas for workarounds?
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com
Blog for (mostly LabVIEW) programmers: Tips And Tricks

The rapidly changing data, is that on the viewing machine or on a display on the device acquiring the data?
The "device acquiring the data" is a pair of cDAQ chassis.  There is no display there. It's the LabVIEW program that is reading and displaying the data.
Does your computer go into any sort of power saving mode where the USB controllers are disabled during hibernation/standby?
on MY machine, I have tried this with CPU sleepage and such.  Didn't know you could sleep the USB, but on MY machine, that's disabled.
But I haven't made it happen on MY machine.
My CLIENT's machine is actually running XP, and is set to turn off monitor NEVER, turn off hard disk NEVER, and system standby NEVER.
What version of DAQmx do you have installed?
On MY machine, it's 8.8 - I haven't found out from my client yet what his is, but it won't be far away from what came with LV 8.6.
Can you post your code?
Well, OK:
Here's two of the loops running (the third loop deals with TCP/UDP and is not relevant, I think).
The TCM DAQ manager 's READ function is pictured in the original post.
Here we wait on a sample, scale it (volts into EU), and feed it to the PROCESS TCM DATA vi (which does averaging).
Here's the NEW DATA function for PROCESS TCM DATA:
The ST (short-term) HISTORY is set up as an N channel by 5-sample array, and ST HISTORY SAMPLES is set to 5.
The DAQ loop, after processing this data, triggers a DISPLAY event, which triggers a DISPLAY action, which lands here:
The GET DISPLAY function retrieves the latest averages:
That data (64 channels worth) is split into two banks and displayed:
The display process simply distributes the array data into clusters (channels can be user-configured to be in various locations on the screen):
The UPDATE TIP action causes a TIP STRIP string to be updated:
The TIP STRIP shows the average and min and max values (which might be hidden from the display itself), based on which display cell the mouse is in.
A MOUSE ENTER event on any display cell sets the CLUSTER CONTAINING MOUSE variable to the CTL REF of the event, a MOUSE LEAVE event for the overall display bank (containing 32 cells) sets the CLUSTER CONTAINING MOUSE variable to Not-A-RefNum.
the DISPLAY looks like this (only a few cells shown).  The display for this program occupies an entire 1680x1050 LCD display, another program runs on the main monitor.
As you can see, the only storage in this process is the AVERAGER, and that is limited to 5 samples (0.5 sec). It cannot store any more than that.
I've thought about the possibility of the mouse oscillating between two cells (as mice are sometimes known to do) when it is parked, and causing a flood of MOUSE ENTER events.
But 1) it happens more often than the odds would dictate  (a random location is not likely to be on a cell border), and
2)  When that cleared up, the queue would be processed, but it would display CURRENT data more rapidly than 2 Hz. NOT historical data.
Given that it seems to be about 100 sec of history (judging by my client's recap of what he saw, and how it operates), that points to the 1000-sample buffer within NI-DAQ.  That's the only place that I see to store that data.
I'll admit that I'm not watching the ERROR output from the NIDAQ READ function. Perhaps I should.
The only scenario I can come up with is that NI-DAQ's READ pointer is confused.
When I ask for a sample it tells me that there is ONE and only ONE available.  So I deal with it.
When I ask again, it tells me the same thing.
When I ask again, it tells me the same thing.
It goes round and round the READ buffer.  At the same time, new data is coming in, replacing the oldest stuff.
But it (apparently) never gets back to the "normal" condition, where it WAITS on a sample at the RAD function.
Nobody has waited long enough to see if it would do that eventually, after a few minutes (50+ replays), they give up and restart.
Restarting the program resets the cDAQ drivers, among other things, so the problem goes away.
If there's another scenario to cause these symptoms, I'm all ears. But I cannot think of it.
If it was a USB SLEEP problem, I wouldn't think the data would replay from BEFORE the wake-up. But that's what happened.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com
Blog for (mostly LabVIEW) programmers: Tips And Tricks

Similar Messages

  • TS4036 I added Icloud to join my calendar to another person. It erased all history date from previous months. how do I get that data back?

    I added Icloud to join my calendar on my phone to another person. It erased all history date from previous months. how do I get that data back?

    i found the answer to the first part: reboot and keep hold of command+r
    this gave me a list of options
    one of them was to reinstall lion from fresh
    i went for this
    dont know why... but all forum posts i read said u should delete hard disc? theres an option for this
    which is the right option?
    any suggesstion where i go to register new mac would be great
    thanks

  • How do I move data from a DAQ into and out of loops and structures?

    I have a set of RTD probes set up to read data into LabView through a DAQ. This block of code is in a while loop
    that executes alongside of several other loops simultaneously. I need to use the data from the RTD probes in other
    loops and case structures specifically for logic tests.
    The problem is that I can't seem to bring the dynamic data out of the DAQ containing while loop or into the other structures.
    Any ideas?
    I have had some success with using multiple DAQs and stopping all others while I need the data inside of a case structure.
    Is there a way to reference data from a DAQ or to run multiple DAQs that read the same data from the same channels without getting a "Task in use error"?
    Thanks,
    -David

    Search the forums for Prodcuer/consumer architecture.
    This uses queues to pass data from the producer loop (such as your data acquisition loop) to other "consumer" loops.  These are the other loops where you want to use the data.
    You won't be able to use multiple DAQ Read functions at the same time.  As you've seen you get error -50103 about the resources already being in use.

  • How do I convert a 1-D array of cluster of 5 elements into a 2-D array of numbers? (history data from a chart)

    Hello,
    in my vi I have a chart with 5 Plots displaying measurement data.
    The user should be able to save all the history data from the chart at anytime. (e.g. the user watches the chart and some event happens, then he presses a "save"-button)
    I know, that I can read out the history data with a property node. That is not the problem. The problem is, how do I handle the data? The type of the history data is a 1-D array of cluster of 5 elements.
    I have to convert that data somehow into a 2 D-array of numbers or strings, so that I can easily save it in a text-file.
    How do I convert a 1-D array of cluster of 5 elements into a 2-D array of numbers?
    I use LabVIEW 7.1
    Johannes
    Greetings Johannes
    Using LabVIEW 7.1 and 2009 recently
    Solved!
    Go to Solution.

    Gerd,
    thank you for the quick response and the easy solution.
    Look what I did in the meantime. I solved the problem too, but muuuch more complicate :-)
    And I have converted the numbers to strings, so that I can easily write them into a spreasheet file.
    Johannes
    Message Edited by johanneshoer on 04-28-2009 10:39 AM
    Greetings Johannes
    Using LabVIEW 7.1 and 2009 recently
    Attachments:
    SaveChartHistory.JPG ‏57 KB
    SaveChartHistory.JPG ‏57 KB

  • How to properly read data from one DAQ-assistant and write simultaneously with another DAQ-assistant (which is inside a loop)

    Hello.
    I'm a newbie working on my Master's thesis conserning a project that is based on old G-code made by another newbie so bear with me.
    I need to create a sequance of output controls. For this I'm using a for loop that eventually creates two triangular ramps during a period of 90 seconds. I've confirmed that this function works properly by measuring the actual output of the DAQ-decice (NI USB 6353).
    The problem is the following: During this controll-cycle I need to simultanously collect data from the same DAQ-device. At this point there is only one DAQ-assistant output-block in the main loop of the program and all the signals are derived from it to where they are needed.There is a case-structure (the bottom case structure in the picture) that contains the functions needed to collect the data during the test cycle. However these two actions, outputting data and inputting data, are not synchronized in any way which may be the reason why I get the 200279 error or alternatively the 200284 error during the test cycle. I've tried changing the sample rate, buffer size and the timeout time as adviced but nothing seems to help.
    What would be the simplest way to solve this problem?
    Help is greatly appreciated!
    Attachments:
    problem.jpg ‏206 KB

    Thanks for quick reply.
    However, I did try it (see the picture) but I still have a problem: I only get 100 samples / channel during the test sequence (all from the first seconds of the sequence) in total even though I've set the data aqcuiring DAQ-assistant as "continous" and "samples to read = 95k" and rate is 1000Hz.
    Edit.
    And lastly, I have trouble adding this "extra" DAQ-assistant to the vi. because I get an error about a resource (The 6353) being reserved, even though I connected a false constant to the "STOP" -input of the main DAQ-assistant.
    Attachments:
    is_this_what_you_meant.jpg ‏212 KB

  • Why the "Import Data from Another Browser" option cannot be chosen

    I click on History on the menu, then, Show All History option, a new window appears called Library.
    I click on the button: 'Import and Backups', a drop down menu appears with the option 'Import Data from Another Browser'; however, this option in my browser is light gray, i.e. I cannot choose it. Why?

    Are you in the Private Browsing mode when you try that Import menu item?
    http://support.mozilla.com/en-US/kb/Private+Browsing

  • Has anyone exported time history data from Labview to B&K Pulse ?

    Hello
    I use a Bruel & Kjaer Pulse 9 system for the NVH analysis of data acquired from a DAT tape recorder. I know about the CompactRIO and I can see its potential as an ultra-portable digital data logger, for field testing. It could for example record signals from microphones or accelerometers into a binary file. But I would then need to "export" this time history data into a file format compatible with B&K Pulse platform.
    Has anybody been thinking about doing exactly that ?
    Thanks
    Philippe

    Hello Philippe,
    Do you know what the compatible format is for your B & K Pulse platform? LabVIEW is able to format data in many ways, if the format you require is some kind ASCII base then LabVIEW will most likely be able to generate this format. It may require more work to format data if this data format is more complex.
    Do you have any more information about the B & K Pulse system? This may be helpful in getting an answer for this question.
    Regards
    Hannah
    NIUK & Ireland

  • Reading data from socket into buffer

    Hi all,
    I'm reading packets of data from a socket, and i want to store it into a buffer array.
    I don't know the packet length, which means i can't really specify the buffer length.
    Is there anyway to get around this?
    Thanks,
    Hugh

    Have a look at BufferedOutputStreamHTH.
    Yu SONG

  • Problem in reading history data from Citadel

    While Iam trying to fetch some (max of 1 hour) data from the citadel database Iam getting some error. I have attached a bmp file which is a screen print of two errors. What is this error ? How can I rectify it ?
    I have re-installed the whole OS & LabVIEW but the scf file is the same, still the problem persists. Is there some problem in the scf file.
    Attachments:
    errors.bmp ‏97 KB

    Thank you Mr. Carl for your prompt reply.
    I want to describe the manner in which my application is storing the data.
    1. I have two folders, one folder contians the current data and the other folder contains the back up data.
    2. Program takes back up every one hour from the current data folder to the backup folder in the the folder of todays date (d:\Back_UP\2004_03_12)
    3. On the next day my application creates another folder (d:\Back_UP\2004_03_13) and the data is now backed up in this folder.
    4. The data in the current days folder (i.e., d:\Back_UP\2004_03_13) is accessable through the VIs in LabVIEW DSC but the problem is in the data which is in the "older folders" (d:\Back_UP\2004_03_11, d:\Back_UP\2004_03_12).
    Note : This app
    lication was running fine on the same PC but I don't know if anyone has done some changes in the configurations or tag file. Right now Iam facing a problem.
    Iam listing my observations in detail for the data in the "older folders"-
    1. I have not tried to fetch the data with SQL through ODBC.
    2. If I give a query for fetching the data from the Citadel using the VIs in LabVIEW DSC I get the errors which are there in the bmp files.
    3. The data is accessable through MAX and I can even export it.
    4. Once the data folder is listed under the "Historical Data" and the MAX is closed Iam able to fetch the data from the Citadel through the VIs in LabVIEW DSC.
    I have LabVIEW DSC 6.1.
    Thank you.
    Ravinder

  • How can I display a avi-file while acquiring data from a DAQ-CARD at the same time

    While my system is acquiring analog data and controlling a motor, I want to display a avi-film (preferably in full-screen, so that the LabView GUI disapears during this process). Are there any VI's to open external players? May I face some problems to lose samples, due to the calling of external players?

    mhi wrote in message news:<[email protected]>...
    > I've already found this example, but it doesn't work with the latest
    > media-player. Anyhow, thank you for your answer!
    you can also try out this free vi from my website:
    http://www.geocities.com/irene_he/FunStuff.html
    Irene

  • How to get the history data from r3?

    Hi Experts,
    I have loaded stock data for jan through the flat file load.
    The stock consists for 2,9,16,23,30 th dates of Jan.
    Remaining dates stock came from R3.
    so problem is stock seems double(Not exactly) for one site(Plant).
    i checked in BI and i dont see any stock data for 31st Jan but it is there in R3.
    So how to get the data for 31st jan from R3 it is using the 2LIS_03_BX Extractor (Tables - MSEG,BSEG).
    i am really stuck up here please help me out..
    Thanks in advance,
    Regards,
    <BMP>

    You can get it from LBWE transaction in R/3 side:
    for example see below:
    Sales and Distribution (SD)          :  application 11, 13, 08 (in LBWE T-code)
    Materials Management (MM)        :  application 03, 02
    Logistics Execution (LE)               :  application 12
    Quality Management                  :  application 05
    Plant Maintenance (PM)              :  application 04, 17
    Customer Service (CS)               :  application 18
    Project System (PS)                   :  application 20
    SAP Retail                                    :  application 40,43,44,45

  • Data Writing Speed for Excel Sheet while taking data from PCI DAQ card

    Dear All,
              I am taking the data form the card EX-92026 pci card and writing those datas into the Excel sheet, now i want the data at the speed of max of 10 miliseconds but while writing the data into excel sheet, it shows the diff of 15 ms betn 2 readings, and the card specs says it takes the time of 500 microsecs to give the data, so is there any effect of timing, while writing data into excel sheet? is labview take more time, i am using the Open file, write file and close file method and write to spreadsheet file method, but none of them is giving me the effective timing that i wamt, so can u tell me how can i reduce it??????
    Thanks,
    Nishant

    Hi Nishant:
    I think I don't understand you very well. If you are using OpenFile, CloseFile and WriteToSpreadsheet VIs, you are not dealing with excel files, but text files.
    Writing to file is costly in time. You can:
    Open the file just once and
    during de process use just file writing VIs as 'write to spreadsheet'... or a more simple one 'write file'
    Close the file once at the end.
    If you need the process to be faster, you can save all the data at 10ms rate in an array and write to file at the end.
    Or write to file every second what you got the last second.
    Hope it helps
    Aitortxo.
    Aitortxo.

  • Acquiring data from daq-pad and saving video at the same time

    I am trying to record data from my daq-pad at 100 samples per second. At the same time I am using a usb interfaced camera to record a video feed. The idea is that when i begin recording data i also begin recording the video feed.
    The way I record the video  feed works fine in its own VI (I need it to record at 30fps and it does this just fine). But when I integrate it with the data record/capture VI the framing rate slows down to only 10 fps. I suspect this is because the VI  gets caught capturing the data from the daq-pad thus slowing down its ability to record the video feed. I was hoping you could give me some help with how to record the data at 100 samples per second and get the VI to capture 30 frames per second. Thanks in advance for anyone who helps out.
    I've attached the VI that has both the data capture and the video capture already integrated.
    Attachments:
    usa_swimming with video21.vi ‏892 KB

    Hi,
    I took a look at your code and the problem is that you have both the data acquistion and the image acquistion in the same loop.  Have you tried using parellel loops?  There is more information about this in the labview tutorials that are available online if you are unsure how to do that.  The problem is that you are doing a lot of things in that loop (acquiring data, doing some analysis, and writing to file), so you can't acquire images very fast because it depends on the speed of the loop iteration.  I hope this helps.
    Have a great day,
    GG

  • Detecting the SAVE of the data to the planning buffer

    Hi,
    When the user has saved the planning buffer data after executing the planning function that has the Exit FM, how can I detect that the data from the planning buffer has been saved from my Exit FM?
    Is there a way to detect that he user has clicked on the SAVE button to save the data in the planning buffer?
    Thanks,
    RT

    Hi Rob,
    A non standard functionality may be to create a custom FM that is called in the exit. Then, you will notice the save inside the custom FM and do what you want and then call the SAP Standard FM to save data.
    Hope it helps.
    Regards,
    Diego Lombardini

  • Writing and Retrieving data from an Excel spreadsheet

    Hi all
    I am working on some battery chargers and need to record the data from my DAQ to an Excel Spreadsheet. How do i do that?
    I don't wanna purchase the Office toolkit from Labview!
    Please Help!
    RJ

    Hi smercurio_fc
    Hi Smercurio_fc,
    Thanks for the reply. I really appreciate your help.
    However, I would like to point out that after making numerous searches, I could not get any VI or thread working for my case. Most of the files complain regarding any of their missing sub-VI(s).
    I myself don't understand the problem. I have even re-installed the application to shoot any of the possible installation errors. I m not a spammer.
    I'll try to do what you have suggested in the former part of your reply.
    Regards,
    RJ

Maybe you are looking for