How do I write snap shot of my data to measurement file every 5 seconds

Hi There
I'm trying take a snapshot of my data stream once every 5 seconds and write it to a .LVM file. I'm having trouble with the "Write to Measurement File" VI. The rate at which it writes data to the file appears to be dictated by the "Samples to Read" parameter in the DAQ assistant. I've tried placing the "Write to Measurement File" VI inside a case structure and initiating the case structure with an "Elapsed Time" VI. This only results in a 5 second delay before the "Write to Measurement File" VI initiates. Once the "Write to Measurement File" VI is initiated it begins writing at 20 x per second. Is there a way to change this or dictate the rate at which the "Write to Measurement File" VI exicutes? 
My reason for slowing down the write rate are, 1) Reduce disk space taken up by my data file. 2) Reduce CPU usage and hard disk access cycles.
The reason I can't increase the "Samples to Read" value in the DAQ assitant (to match my data writing requirement) is that my VI will begin to miss events and triggers.
I'm sure I can't be the only person who needs high frequency data acquisition and low frequency writing of the processed data to disk? I can't however see a straight forward way of achiving this.
The hardware I am using is a NI USB 6008 DAQ, acquiring analogue voltage data at 100hz.   
Thanks in advance for your help
Cheers
Kim
Solved!
Go to Solution.

The case structure and the elapsed time function should work. Did you configure it to reset when the time target is reached? You should get a single true and then the output will be false until the time has elapsed again. The write to file would not be running 20 times a second. Post your code if you still have problems.

Similar Messages

  • How to speed up the loading of live data into flash file.

    How to speed up the loading of live data into flash file if the swf file size is 1.5 MB. Flash file is using 20 web service connections to load the live data.

    Hello,
    I am also facing a similar problem wherein the SWF file takes time to load the refreshed data in Infoview i.e. after exporting the xlf file to Business Objects platform. Currently I am using Xcelcius Engage/Enterprise 2008 SP3 Windows (file name: 51038212.ZIP) version 5.3.0.0 build number 12,3,0,670. Also the SWF file is approximately 2MB in size  and it uses 42 live office connections.
    Please suggest solution as to how to decrease the time it takes to refresh the live office connections.

  • How to save multiple snap shots in one file?

    Hi,
    I've been trying to take snap shots using a USB camera and save the
    them into one file; however, I've had no luck with the saving part. Can
    anybody help me with this problem? I've attached the code I'm using in
    case anybody wants to take a look.
    Thank You,
    Molana
    Attachments:
    Camera Snap Shot1.vi ‏100 KB

    Hi Molana,
    If you are looking to save these images to file, you can use either the IMAQ Writefile VIs, or potentially the AVI writefile VIs.  These VIs are both on the FIle I/O palette of the Vision Utilities subpalette.  To write an AVI file, you <b>open</b>, write to, and then <b>close</b> a session, very similar to most processes in LabVIEW.
    I also noticed in your code that you are enumerating your USB cameras and closing the camera session all within the while loop.  This adds a great deal of overhead and time to your acquisition process.  I would recommend moving these processes outside of the acquisition loop, such that they occur once before and once after the snaps.
    If you are still having trouble acquiring, I would recommend that you download and install the NI IMAQ driver.  It includes examples for snapping and saving images with NI IMAQ.  This process is extremely similar to that which you would use in NI IMAQ for USB.
    Hope this helps!
    Robert

  • HT2477 how to make a snap shot of a selected text

    Im trying make a snap shot of a selected text.

    To take the picture of a part of the screen
    Command (⌘)-Shift-4, and then drag the crosshair pointer to select the area. Continue to press the mouse button, release the keys, and then press Shift, Option, or the Space bar while you drag to resize the selection area. When you are ready to take a picture, release the mouse button.
    Pictures of the screen (screenshots) are saved as files on the desktop, but if you prefer to put a screenshot in the Clipboard, hold down the Control key while you press the other keys. You can then paste the picture into a document.
    http://support.apple.com/kb/PH11229
    http://www.wikihow.com/Take-a-Screenshot-in-Mac-OS-X

  • How do I write a cluster of an array to a file that can be looked at with other applications?

    I have a cluster of array that are different data types. How do I write this to a file, so that other applications can read it, i.e. notepad etc?

    Each elements of the array has a cluster of different data. It is unbundled and separated by a comma , then converted to a string. It is indexed out to a CSV array and then written to a spreadsheet file. The spreadsheet file reads it and outputs a CSV array. This is then going into for loop to reassemble the string output to its original clustered data representation. The iterations puts the clusters back into the array at the correct indexed position.hint: the for loop is the key to manipulating the array data...this VI is like an egg to a chicken and chicken to an egg, whatever came first?
    Attachments:
    disassemble_assemble ARRAY.vi ‏20 KB

  • Can anyone help me write a code about coping data from many files and paste them to one file !?

    Hello ! 
    As I said in title , I have alot files (e.g. 60 files) and I want to write a code to copy 5 columns (for examples) of special sheet of files and paste them in one file respectively. For perceive it I explained it more below .
    Suppose one of my files is simplified as this : http://s000.tinyupload.com/?file_id=00699705919876414523
    The name of  this file is 2006Oct and assume my excel files are like "2006Oct, 2006Nov,2006Dec,2007Jan ... 2010Dec". At first I should go to "my files" sheet of 2006Oct file and copy columns " A,B,C,D,E,F " that has "PerturbationNumber=1"
    respectively and then paste these to a file that is output file and repeat this process for the other files ( 2006Nov and etc ) and paste data in output file sequentially. 
    I appreciate and look foreward for any help in this issue.
    Majid

    Try code below
    Sub CombineBooks()
    Dim wb As Workbook
    Dim sourceSht As Worksheet
    Dim destSht As Worksheet
    Set destSht = ThisWorkbook.Sheets(1)
    destSht.Cells.Clear
    FolderName = "C:\temp\test\"
    file = Dir(FolderName & "*.xlsx")
    firstSht = True
    Do While file <> ""
    Set wb = Workbooks.Open(Filename:=FolderName & file, ReadOnly:=True)
    Set sourceSht = wb.Sheets(1)
    With sourceSht
    sourceLastRow = .Range("A" & Rows.Count).End(xlUp).Row
    If .Cells.AutoFilter Then
    .Cells.AutoFilter 'turn off autofilter
    End If
    .Cells.AutoFilter Field:=6, Criteria1:="1"
    If firstSht = True Then
    Set copyRange = .Range("A1", .Range("E" & sourceLastRow)).SpecialCells(xlCellTypeVisible)
    destSht.Range("F1") = "FileName"
    firstSht = False
    destNewRow = 1
    Else
    Set copyRange = .Range("A2", .Range("E" & sourceLastRow)).SpecialCells(xlCellTypeVisible)
    destNewRow = destSht.Range("A" & Rows.Count).End(xlUp).Row + 1
    End If
    copyRange.Copy Destination:=destSht.Range("A" & destNewRow)
    LastRow = destSht.Range("A" & Rows.Count).End(xlUp).Row
    If destNewRow = 1 Then
    destSht.Range("F2:F" & LastRow) = file
    Else
    destSht.Range("F" & destNewRow & ":F" & LastRow) = file
    End If
    End With
    wb.Close savechanges:=False
    file = Dir()
    Loop
    End Sub
    jdweng

  • FSCM Documented Credit Decision SnapShot - how to remove the Snap Shot linked object

    Within the Documented Credit Decision linked objects there is the SnapShots for credit decisions section. I'm trying to remove this folder from the linked objects area. Also the linked objects folder titles are in German unlike all other areas of the case which are in English. Does anyone know where I need to make the adjustments to correct the language and remove the SnapShots from being displayed? Your insight is greatly appreciated.

    Hello John,
    1. T-Code : SCASE --> Select the second node "Records and case Record Models" you then get a drop sown -->  for the Modelet in the case record in SAP Credit Management  --> right click and choose find --> a new window opens --> direct execute (F8) --> Select DCD case Record --> on the right hand side you would be able to see 4 folders -->  the second fodler is snapshot nod deactivate that. node and i think then you should be able to see SNAPSHOT  in Object when i a normal DCD is created in linked Objects.
    Also we have one more option that is the badi which is used for SNAPSHOTS.
    You need to activate that badi in case if you do not want to use the SNAPSHOT functionality.
    I repeat you need to activate the badi if you do not want to use the SANPSHOT fucntion .
    SPRO--> Financial Supply Chain Management -->Credit Management --> Credit Risk Monitoring --> Documented Credit Decision --> Enhancements --> you would be able to see the 3 badi's  you need to activate the second one.
    Regards
    Sai

  • How can i write and read the same data

    hi,
             i have attached my program to this mail. i have some problems in this program.
    problems:
    1. I want to select the threshold for the rms,varience and s.d.
    But what i used is not doing that. i want to fix the upper threshold value and lower threshold value.
     when ever the input crosses upper threshold value i want the output and it will remains uptill the value above the lower threshold value.
    Once it come down the lower threshold value the output should be stopped.
    2. I want to write this in to a  file and i want to read this file. is this possible or not. 
                please try to help me i am very new with lab view6i
           REGARDS
    CHAMARTHY KOMAL DILEEP.
       [email protected]
    Attachments:
    dileep.vi ‏93 KB

    The easiest way to perform a certain action (such as file I/O) based on a certain condition (such as whether a value has passed a certain threshold) is to use a comparison VI in combination with a case structure. Then you can specify that if your rms, standard deviation and variance are above a threshold then perform a certain action.
    Also consider using shift registers to keep track of data from the last loop. If I understand you correctly, you want to start logging data when an upper threshold has been passed. Then you want to continue logging data until a lower threshold is passed. I have attached a non-functional but explanatory VI that will help explain how to implement logic to that effect. It also demonstrates that you can indeed write and read from the same file in a loop. The best way to do this is to open the file before the loop, do all the necessary writing and reading in the loop, and then close the file after the loop.
    Hope this helps!
    Jarrod S.
    National Instruments
    Attachments:
    dileep_example.vi ‏61 KB

  • How can we write BDC program to upload data in to line items(VA01) ?

    Error in processing BDC table control program...
    How can i populate data through bdc program dynamically, when some of the lines are in disable mode....
    for e.g ...
    in va01 transaction code ....
    1 to 5 lines are not in disable mode....
    but 5 to 10 lines are in disable mode...
    so hw u process those remaining disable lines at runtime and populate data in to the fields of line items...through bdc program..

    hi..friends.,
    yea actually this question has been raised by interviewer ...
    but just the same i replied as you did...
    but he told that we can upload the data....towards in to disabled line items
    at run time..with using change trasaction va02..with implementing bdc programm...
    so i just want to know the steps of how to perform it..
    Can anyone....my friends..
    byeeee.....

  • How can I write a checkbox.label into a server text file?

    Hello, world...
    I have a problem...
    I need to write into a server text file the label of the selected checkbox..
    The client side script is:
    private function writeFile (e:MouseEvent):void
                 if (cb1.selected == true && writeBtn.label == "Conferma")
                     nc.call ("WriteNow",null,"La lettera iniziale è:"+cb1.label+"\n");
                     writeBtn.label = "Fatto";
                 else if (cb2.selected == true && writeBtn.label == "Conferma")
                      nc.call ("WriteNow",null,"La lettera iniziale è:"+cb2.label+"\n");
                     writeBtn.label = "Fatto";
                 else if (cb3.selected == true && writeBtn.label == "Conferma")
                       nc.call ("WriteNow",null,"La lettera iniziale è:"+cb3.label+"\n");
                      writeBtn.label = "Fatto";
    ...and the server side script is:
    var anVis = new File("Analisi_Visiva.txt");
    fileWriter.WriteNow = function(cliMsg)
            anVis.open("text", "append");
            if (anVis.isOpen)
                 anVis.write(cliMsg);    //line 17.
                 anVis.close( );
    I have this error in the Live Log of the FMS3 Administration Console:
    Sending error message: C:\Programmi\Adobe\Flash Media Server 3\applications\AnalisiVisiva\AnalisiVisiva.asc:line 17:File operation write failed.
    Why doesn't It work?
    Please, help me...
    Emiliano.

    Hello,
    In order to download your internal table just call the following fm:
      CALL FUNCTION 'TB_LIMIT_WS_DOWNLOAD'
       EXPORTING
      BIN_FILESIZE                  = ' '
         filename                      = dest
         filetype                      = 'ASC'
         mode                          = 'O'
       IMPORTING
         filelength                    = filesi "Bytes read
        TABLES
          data_tab                      = p_ti_temp "your IT
       EXCEPTIONS
         file_write_error              = 1
         invalid_filesize              = 2
         invalid_type                  = 3
         no_batch                      = 4
         unknown_error                 = 5
         gui_refuse_filetransfer       = 6
         no_authority                  = 7
         OTHERS                        = 8
    Hope this helps
    Gabriel

  • How do I write the contents of a string array to file?  Is there a package

    freely avaliable to do this? I am writing a console program that will save the selections made to file. I have convenience packages that came with my book, it allows int and double arrays to be written to file, but not string arrays. Any help would be greatly appreciated.
    Thanks,
    Joe Lavender

    One easy way to do this is to populate a Properties object with the index as the key and the element as the value.
    The properties has built in methods for writing it to file and reading it in.

  • How to process other task when reading the data from a file?

    Hello,
    I met a problem. I created a GUI to control the audio data processing. When the "Start" button is pressed, a block of data is read from the audio file and processed, then loop.But other buttons or method cannot be operated in that procession until all data is processed.
    How to let the other methods work under that circumstance? Should I use multiple threads?
    The relative code:
    SourceDataLine line;
    boolean stop = false;
    // When press "Start" button, the following method is invoked:
    public void play(){
    line.start();
    int bytesRead = 0;
    byte[] dataBuf = new byte[7500];
    while (bytesRead != -1& !stop)
    try
    bytesRead = audioInputStream.read(dataBuf, 0, dataBuf.length);
    catch (IOException e)
    e.printStackTrace();
    if (bytesRead >= 0)
    int bytesWritten = line.write(dataBuf, 0, bytesRead);
    line.drain();
    // When press "stop" button, this method is invoked.
    public void stop(){
    stop = true;
    line.stop();
    // When press "***" button, the following button is invoked:
    public void ***(){
    Many thanks.Looking forward to getting your answer.

    You have to use a seperate thread :
    Wheb you press the start button, you have to make sure a seperate thread is started :
    Thread runner = new Thread(){
    public void run(){
    //Here comes your code which reads the file
    runner.start();
    KR,
    Jan

  • How do i use Java to read the data in XML files?

    Hi,
    I'm rather interested in using XML in my javacodes, as i think it will be of more OO.
    I want to make use of XML in my javacodes,
    but i don't know how to start doing it, so i hope someone would be able to enlighten me on this,
    =)
    Some examples would be perfect

    Humm interesting...well here is the link to Sun's tutorial on how to use maipulate an XML document using Java's jaxp api.I hope this will give u a hint.
    http://java.sun.com/xml/tutorial_intro.html
    Khalid

  • How do you make iTunes read updated tag data from a file?

    This is such basic functionality that I'm sure I'm just missing it. It used to be the when I modified a file using a third party application (or editing a shared library using iTunes running on a different machine), all you had to do to get those updates into iTunes was select, hit "get info" and click OK without changing anything. That broke in 9.2 - it still recognized that the file has changed and adjusts the Date Modified field, but doesn't actually update any of the fields.
    The revised tags don't get updated until you either Get Info individually on each file, play the file, or modify the files. So realistically, there are no workarounds - the first two aren't realistic for a full library and the latter trashes your modification date and causes the refresh to take hours to complete if the library is on a remote server, rather than the ten minutes it used to take.

    turingtest2 wrote:
    Hi,
    I've written a script called UpdateTagInfo which should do the trick for you. Just select a bunch of tracks or an appropriate playlist and call the script. It will process each track, updating the tags if they've been changed externally. When complete it will tell you how many tracks were processed & how many were updated.
    More scripts at http://samsoft.org.uk/iTunes/scripts.asp
    tt2
    This is great! Thanks for posting and letting us know...
    Sandy

  • How to create BOM(Bill Of Material) item data from flat file?

    I have two flat files one is BOM(Bill Of Material) header data and BOM item data. BOM header is already created, now I want to create BOM item data with reference to the header data. Is there any standard direct batch input method in LSMW or Is there any standard BAPI or Is there any standard BDC report program to do the task? CS01 is the TCode to create BOM.

    Hi,
    The DI program works for create step CS01 and not for CS02.
    Perhaps this ( adding items in header by Tx: CS02 ) could be achieved by a Recording step in LSMW.
    Best Regards, Murugesh

Maybe you are looking for