Auto Save to Spread Sheet file every N samples

I am in the need for a way to automatically save data to a file for every N-samples that are acquired.  I've written the attatched reentrant subVI, but there are some problems.  Whenever I have it in my program loop it hogs the process (stalling data acquisition) and just writes the initial values a bunch of times (the file quickly goes into the 10's of megs).  I don't know where I'm going wrong in my algorithm.
Here is the algorithm I'm trying to realize with this subvi.
Inputs:
1. 1 x M array
2. number of samples to record at a time (N)
3. path to folder to automatically save files
Algorithm:
Initial run:
1. Create file name based on current date/time and folder path input.
2. Initialize an array that is N x M (so the number of rows is the number of samples to record, by the number of columns coming from the input).
3. Place the first row of input data into the first column of the array.
Subsequent runs:
1. Place the input data into the next position of the N x M array
2. If and only if current_input_count % N == (N - 1) then save the data to the autosave file.  (note: %=modulus operator)
My typical sample rate is around 2-5 samples per second.  I need this because some of our tests are really long (like hours long), and if the DAQ computer fails to save the final data set then we pretty much lost the entire test.
Sorry my G code is so sloppy.  Thank you for any input.  I'm targetting LabVIEW 8.
-Nickerbocker
Attachments:
Auto Save N Points.vi ‏22 KB

For "automatically saving the data to a file for every N-samples that are acquired", you might have to use LabVIEW measurement file for storing your samples. Also, I have slightly modified your code. Double click on the LabVIEW Measurement file and then check different options available to store your samples. Hope this helps.
PS: Assuming that this is the only probelm you have, I didn't go through your algorithm.
Attachments:
Auto Save N Points.zip ‏51 KB

Similar Messages

  • Error 7 produced when saving to a spread sheet file using a compact rio

    Hi
    Im having a little difficultly saving to a spread sheet file using a compact rio. I bundled the data from a NI 9215 with a timer and stuck it into an x-y graph and that works fine as it goes round in shift registers. But then I passed the data out of my while loop unbundled it, turned it into a 2d array and tried to write it into a spread sheet file using the appropriate i/o vi provided by labview 8.2. I have hooked up all the requirements like format, and file path. But it keeps returning error 7 and says that my file path is incorrect. I’ve tried using a constant file path, ive tried creating the file before running the program, ive tried just writing the file straight to a disk in this case h:\test.asc but every time it comes back with error 7. I then went to a lab downstairs to see how they did it and the method I’m using it works down there but is exactly the same as mine upstairs. I’m a little confused by this one.
    Any pointers would be much appreciated.
    Dan

    Hi
    I apologise I didn’t specify I was only using a NI cRIO-9004 not realising you could get ones that had a USB port. I thought mine would behave in the same way as a DAQ device and write the file back onto the main computer hard drive. Is this not what happens if not how do you make it do that. The computer is a networked system with its own C:\ harddrive, but my personal space is on H:\ which must be like a pretend hard drive, or alternatively can you make the cRIO write it to a memory stick within a USB port of the programming PC itself. Or can you write onto memory of cRIO but then how do you download the data?
    Also I apologise that I posted the message twice only did cos I thought it might be in the wrong forum.
    Thanks
    Dan

  • Auto save and very large files

    Hi  All,
    I produce very high dim artworks, 6m x 2.7m(+) image at 200ppi, sometimes when I load the files Photoshop cc2014 would randomly will crash. This never happened with my CS5 version. I have auto save checked, could this be the issue?
    I am running a high end computer with 32gb ram, 8 ssd's with two dedicated to PS scratch disk....the images, so far, load eventually but the heart beat stop moment when you think a file is corrupt really scares me, especially when $$$$$ are involved.
    Any ideas?

    Thanks JJMack
    I will try it. It is possible it's not the auto-save feature, cs5 was rock solid and gave me confidence as it never crashed even with files over 5gb. The crash report states the faulting model is unknown for the last crash but I have seen ntdll.dll as the faulting module in previous crashes.

  • QuickView (run in backgroud) - How to auto save data to local file

    I am using Quickview to extract data. I want to run the Quickview query in background and auto save the data extracted into local file (ASCII file). Currently when I specify File Store (as my Output Format) and enter a file name (e.g C:\Temp\test.asc). Upon completion of extraction there is a little window popup that need me to select data format (e.g DAT, ASC) and click <Transfer> button to proceed to save data into local file.
    Is there a way that I can save data into local file without have to manually select ASC data format and click <Transfer> button. I will not be  able to schedule my QuickView query to run in background if I can't resolve this problem.
    Note that I don't have access to ABAP programming, therefore this option is out.
    Thanks in advance to anybody who can share your expertise experience.

    Tyr Fm's
    1. WS_UPLOAD
    2. GUI_UPLOAD
    But using gui_upload and ws_upload can only upload data from txt.
    actualy we have software to convert pdf to text file it freely availabe in internet...
    after conversion you can use thesr fms.
    plzz reward points usefull
    Cheers,
    Chandru

  • Transport Import History save to spread sheet

    Hi,
    I have successfully saved the Transport import history as a spreadsheet.
    i.e. System > List > save > local file > Spreadsheet
    However, the Return code column is blank? Probably becuase the image did not convert to text?
    Does anyone maybe know what I can try to get the return code populated next to the transport in the spreadsheet?
    Kind Regards,
    Chris

    Juan, Thanks for the info.
    I have also found this table to be very useful - TPALOG.
    From this table I was able to extract the import history of the system I was looking for as well as the return code.
    Kind Regards,
    Chris

  • Multi spread sheet files, continuously.

    I am figuring out how to read the multi spreadsheet files continuously, 
    i tried bundled them and add them together but it dint came out as i expected.
    the progrram i attched is fully working but only for 1 file.
    anyidea how to make it to read many spreadsheet files and show as weekly, or monthly data analysis
    Attachments:
    multi file reading.vi ‏1604 KB
    spreadsheet.zip ‏773 KB
    multi file reading.vi ‏1604 KB

    Try the attached vi.
    The best solution is the one you find it by yourself
    Attachments:
    multi file reading-1.vi ‏2534 KB

  • Creat file to write to spread sheet

    Hi all,
    I'm trying to save my voltage and time data after DAQ. The data went
    out OK. They are built to be a 2D array and I transposed them.  I
    wish to write them in Excel and thus can process data in that.
    I used  "File Path Control", "Open/Creat/Replace File', and
    connected the refnum to "Write to Spread Sheet File". Now I have two
    questions about writing to spreadsheet file.
    First, I'm using Labview 8.0, and there is no dialog pops out even if
    the "File Path" is empty. If I enter file path firstly, I have to
    specify .xls in order to create a Excel file. How to make the dialog
    telling me I haven't select a file path pop up in case I forgot and all
    the data would be lost?
    Second, Is there a way to append string head to a spread sheet? For example, time   (tab)  voltage?
    Thanks a lot!

    hi learner2,
    if you want to wrtie to an excel file directly, you can try to use a wrtie to spreadsheet vi on the functions palette in file I/O . you can connect your 2D array to the input, specify the format and it will automatically ask you the location where to save your spreadsheet. Try using find examples and type "excel" in the search field to find more examples regarding spreadsheet .

  • Graph to spread sheet

    how to save a front panel graph to a spread sheet file programatically?

    Hey Muralidharan,
    I would suggest that you use ActiveX to generate your graph in excel. But this is a two step process, first you will need to save the graph to file. This can be achieved using an invoke node of the graph and setting a file location. Once the file location has been stored you can use the activex functions to insert it into your excel document. I have sent a link that should help you to generate the activex function for your specific problem. If you get stuck at any point please feel free to ask and I will help as best I can.
    How to create an invoke node of a graph:
    http://forums.ni.com/t5/LabVIEW/How-can-I-easily-make-a-screen-shot-of-a-polar-graph/m-p/1198851#M51...
    How to create the activex function:
    http://forums.ni.com/t5/LabVIEW/How-can-I-add-excel-pictures-using-activex/m-p/1002526
    Regards
    Andrew George @ NI UK

  • How to find zeros in a spred sheet file

    I have a spread sheet file having 33 column I want to find  is there any zero in any of the columns,how this can be done easily.searching one dimensional array is time consuming since file size is very large
    thanks for your time
    regards
    augustin
    Certified LabVIEW Associate Developer
    Solved!
    Go to Solution.

    johnsold wrote:
    If the spreadsheet file is a text file, you could use the string functions to search for the presence of zeros.  The details would depend heavily on the format in which the data is saved.
    For working with numeric values another caution is in order.  In this case it probably would work to use the Is Equal to Zero comparison primitive, but remember that in general equality comparisons on floating point numbers are not a good idea due to the finite representation in binary and roundoff errors after calculations.  Adapting Matt Bradley's suggestion you might test whether the absolute value is less than some tolerance, such as 1e-6, rather than zero.
    Lynn 
    Lynn- good point! but use abs val and compare to the machine epsilon  (that "little e" constant on the numeric>constants sub-palette is the smallest value that the computer can represent as a dbl)
    Jeff

  • Feature request: auto-save timer reset

    The auto save timer currently runs continuously: every n minutes, it auto-saves if the project has changed. It should auto-save n minutes after the last save whether auto or not. That is, any save action should reset the countdown timer. Also, auto-save shouldn't start while a manual save action is in progress.

    There is a better way.
    http://forums.adobe.com/thread/1369232?tstart=0

  • Could u plz help me to find simple example for how to save data file in a spread sheet or any other way in the real time controller for Sbrio 9642 using memory or usb flash memory

    Could u plz help me to find simple example for how to save data file in a spread sheet or any other way in the real time controller for Sbrio 9642 using memory or usb flash memory

    Here are a few Links to a helpful Knowledge Base article and a White Paper that should help you out: http://digital.ni.com/public.nsf/allkb/BBCAD1AB08F1B6BB8625741F0082C2AF and http://www.ni.com/white-paper/10435/en/ . The methods for File IO in Real Time are the same for all of the Real Time Targets. The White Paper has best practices for the File IO and goes over how to do it. 
    Alex D
    Applications Engineer
    National Instruments

  • ALV truncation while download using  List--Save/send--File--Spread sheet

    Experts,
    In ALV output, I am trying to download using menu item
    "List --> Save/send  --> File --> Spread sheet" then in the popup appears
    here if i GIVE the FILE NAME THEN,material number is getting truncated.
    If I don't give any file name it is storing as ".xls" and not getting truncated.
    How to correct this or avoid this truncation.
    OR
    If we can't do correction about truncation ...my function consultant is asking to
    to disable "List --> Save/send  --> File".
    Thanks in advance.
    Sam

    Solved by my own....
    We need to pass
    i_fieldcat-no_zero = 'X'.
    so that the zeros at the end  won't get truncated.

  • How many sheets can you save in a Numbers file?

    Hi folks.  I am desperate for help.  I have a very important Numbers file that I am working with, where I need to add 289 "sheets" to a single file.   Everythign was fine, until I am trying to add my 146th sheet.   When I add that next sheet, It will no longer auto save or let me manually save!
    I can't find any file size or number of sheet limits.
    What can I do?  I really must have each sheet on the same file.
    Please advise.
    Drew

    Drew,
    According to the following discussion, Yvan Koenig states that you can have 255 Tables per Sheet and 255 Sheets per Document:
    https://discussions.apple.com/message/7813797#7813797
    In my opinion, anything approaching this order of magnitude belongs in an Office or Office-clone app. Numbers is bound to choke sooner or later with this much data.
    If you are certain that you haven't hit one of these limits, there may be other reasons you can't save that we can't guess with the information that you provided.
    Jerry

  • How can I continuously auto-save and auto-name the JPEG files with a controlled time interval

    Hi,
    I am newly involved in some Labview projects that out of my knowledge. I am trying to save multiple JPEG images from a live imaging task to a folder in the computer hard disk every certain minutes. I'd like to name these files with the date and time (eg. Img_06012011_1635. jpg).Then, after hours long image capturing, I can have all the image files in a neat order.
    My goal is to have the jpg files auto saved and auto-named with the data and time at that moment. I also need to control this waiting time between each savings.
    Could you please show me some hints about this? See the vi attached, I know I need to do something on the "write path" part on the up right corner. Thanks!
    Solved!
    Go to Solution.
    Attachments:
    capture.vi ‏28 KB

    Thanks, Steve. When I built up a path with the date and time info and send them to the WriteJPEG File.vi like you mentioned, it stopped saving any files into the folder. Do you think this is the problem from my while loop?Could you show me if there is any other secret functions that restrains the file saving?
    I am planning to save the image files every 30 secs,for example, and then I can have a bunch of jpg files with their unique names after hours long image acquisition.
    I appreciate you kindly help!
    Attachments:
    capture(updated).vi ‏29 KB

  • Premiere CC - no auto save files since yesterday

    Hi
    I have been working all day in Premiere CC - then crash. That happens, but when I realize that there is no auto-save file from today I get quite frustrated to put it mildly (yes I know I should have saved manually). Does anyone have a clue what can cause such a fatal error? I have searched the system for newer auto-save files with no luck. This is going to be a terrible night!
    Here is a screenshot of my auto-save folder:
    I am working on a Retina Mac - OS X Version 10.9.4 2,7 Ghz 16GB ram. Premiere CC 2014.0.1

    I just had the same problem and lost a project due to this.  I was working on something for the past two hours and there have been zero auto saves since the other day.   Sucks, it's setup to do this every 15 mins and it didn't even do it once during this most recent session.

Maybe you are looking for