Save waveform data with corresponding time array to spreadsheet file

Hello to all
I am looking for a possibility to save voltage data acquired and displayed continousely to a spreadsheet file. Acquiring and displaying is not a big problem, but I have troubble to save the data with the corresponding timestamp with more than seconds accuracy. I am acquiring the data at 1000 Hz and read packages of 500 samples. The recording time should not be limited, it will be started and stopped manually. In fact the acquired voltage data first has to be scaled and than saved. If I use the 'WRITE WAVEFORM TO SPREADSHEET' VI the time column is in seconds' accuracy and that is not what I need. If I create my own time array from the waveform parameters I have timing problems. The accuracy in time should reflect the sample rate. I will attach one of my not very successful trials for better understanding.
please help a newcomer!
Thanks in advance
Thomas
LV 7.1
Attachments:
display & record forces v.1.0.vi ‏181 KB

I usually follow a simple method to generate time stamp
I keep sampling rate and number of samples to read as equal and do as shown in the attached VI
I also remember building a VI with a small modification to this time stamp generation logic to cater to acq, where number of samples to read is half/one fourth/one tenth of sampling rate specified, but cannot find that VI.
Hope this helps
Regards
Dev
Attachments:
Acq_DAQmx_filesave_time stamp.vi ‏121 KB

Similar Messages

  • I have a string 2012-05-22T23:23:42.263-07:00. so i want to convert in date with indian time zone   can any one help me out

    i have a string 2012-05-22T23:23:42.263-07:00. so i want to convert in date with indian time zone   can any one help me out

    What does this have to do with iPhone tech support?

  • Save a panel with a graphic into a bmp file

    I need to save a panel with a draw to a bmp file or a jpeg file, but I don't know which classes and methods I have to use.
    Thank for your help.

    Sorry, made an incomplete posting!!
    Here's all the code, hope it helps!
      public Image getScreenshot()
           double scale = 0.67;
              BufferedImage result = new BufferedImage( this.getWidth(), this.getHeight(), BufferedImage.TYPE_4BYTE_ABGR );
              Graphics2D g = (Graphics2D)result.getGraphics();
    //          g.scale( scale, scale );
              paintAll( g );
              // Crop image
           result = result.getSubimage( m_borderThickness,
                                                                                  m_borderThickness,
                                                                                  m_width-m_borderThickness,
                                                                                  m_height-m_borderThickness
           // Save as JPG
              String fname = "D:\\temp\\test4.jpg";
              try{
                   FileOutputStream out = new FileOutputStream( fname );
                   JPEGEncodeParam param = JPEGCodec.getDefaultJPEGEncodeParam( result );
                   param.setQuality( 1, false ); // use maximum quality
                   JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder( out );
                   encoder.encode( result );
                   out.close();
              } catch( IOException e ) {
                        e.printStackTrace();
                        throw new Error( "Could not save " + fname + " with JPEGImageEncoder" );
              // Load and Re-Scale JPG
              Image img = new ImageIcon( fname ).getImage();
              return result.getScaledInstance( (int)(result.getWidth() * scale),
                                                                                            (int)(result.getHeight() * scale),
                                                                                             //Image.SCALE_DEFAULT
                                                                                            Image.SCALE_AREA_AVERAGING
                                                                                            //Image.SCALE_SMOOTH
      }

  • Saving data with automatic time intervals

    Hi everyone
    I am a new user with LabVIEW (I just started using it 3 weeks ago) and I am having a problem with data recording and saving.
    Basically, what we want to do is to monitor data for four different variables countinuosly but saving them in automatic and specified time intervals. Specifically, we would like to save data countinuosly only for five minutes each hour. After the 5 minutes, only the saving function must be stopped for 1 hour then return to record for 5 minutes without shutting the major loop. Additionally, we would like to collect all the data in this way in one exel file per day for three weeks or more, so instead of creating a data file for each recording we would like to collect them in only one file per day.
    Finally, if its possible, we would like to extract the mean of the data for one day in a single file.  We are not interested in modifying the rate of data aquisition, we only want to focus on the saving rate. We tried many timed function (as Elapsed time, Time delay, Wait) and timed loops but it was impossible for us to syncronize different loops or to set up timing function for the saving issue without blocking the main loop work.
    Data are collected throught the "write to measurement file" function.
    any kind of help will be really appreciated!
    Here we submit our front panel and block diagram of our VI.
    Best regards
    Solved!
    Go to Solution.
    Attachments:
    Hypoxia 21-05-2014 Monitoring.vi ‏451 KB

    Use a shift register to keep track of your start time.  If the difference between the start time and the current time is less than 5 minutes, save the data.  If the time difference is an hour, save the new time as the start time.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to combine sql.Date with sql.Time into one?

    I have a database where I keep dates and times separately, and getting date only and time only out of a java.util.Date is no problem thanks to the classes java.sql.Date and java.sql.Time. However, I need to read these values back in, put them back together, and then do date comparisons with java.util.GregorianCalendar. I tried just adding the millisecond long values together but that didn't seem to work, and I've tried setting the year, month, date, hours, minutes and seconds individually into a GregorianCalendar but I haven't figured that out yet. Certain queries work out better keeping the date and time separate in the database and it takes less bytes than a timestamp, so please don't suggest I use a timestamp!
    Thanks for your help!
    Stephen

    You can add the milliseconds (ms), but you need to use just part of it. For this example, let X be one more than the maximum number of units in time and also the minimum number of units in date. If we were using hours instead of ms X would be 24.
    t = total ms from time
    d = total ms from date
    T = new combined time
    T = ((d / X) * X) + (T % X);Add (the date, rounded to the nearest day) and (the portion of time which is less than a day).

  • Save waveform data to .TXT

    Hi all,
    I'm acquiring data from one machine. I show all data from each channel on graph, which works OK, for different sample rate. What I want is to save this data to .TXT file.
    Please take a look at my picture. What I need into .TXT file is value for each channel at each iteration. I tried to save  "value" Y from each "build waveform", but what I get is data on picture. It's always saving previous data(see picture at bottom), but I need just:
    17:49:16
    28,192885
    17:49:16
    28,193563
    17:49:16
    28,193902
    PICTURE:
    Rookie; LV 2011 on WIN 7

    I'm saving like this (I know I must put "open and close" block outside of while loop, but this is not my problem right now). How can I index then to save just value of each itteration...
    Rookie; LV 2011 on WIN 7

  • Multiple channel data with different time stamp logging

    I have peaks and valleys from multiple channels with different time stamp but I am not able to log to a single file. Any idea on how to do this?
    Attachments:
    Single Point Peak Valley Log.vi ‏53 KB

    Hi Dennis,
    Sorry for that I have modified the VI.
    Because the peak and valley of every channel will occur at different time and I want to log the peak/valley with the time stamp.
    How can I log them on the same file.
    Attachments:
    Single Point Peak Valley Log_Mod.vi ‏53 KB

  • Writing 2-D array to spreadsheet file changes value of time column when saved

    I have a program that creates a new row in a table each time the loop performs.  Each time the loop performs and a row is added to the table, the program uses the "write to spreadsheet file.vi" to save this new table over the previous table.  The array is also visible on the front panel of the vi.  The program works in such a way that you can stop adding data to the array, start adding data to a new array, then come back to the original by using the "read from spreadsheet file.vi".  My problem comes after opening the spreadsheet file.  The first column of the array, which corresponds to the time when the data in that row was taken, has different values than those that were seen when the array was originally displayed on the front panel.  In fact, all of the rows that were created the last time the program was run with that array have the same value in the time column, while all of the other columns keep their correct values.  Here is an example of what is happening...
    When I start the program, and run it for 5 iterations, I get a table like this displayed on the front panel:
    3241713920
    85.88012
    93.88012
    1.735015...
    3241713930
    85.97603
    93.97603
    1.747003...
    3241713940
    84.58855
    92.58855
    1.573568...
    3241713950
    84.48096
    92.48096
    1.560119...
    3241713960
    84.93667
    92.93667
    1.617084...
    This array is saved to the spreadsheet file with each added row.  If I initialize and build another array, then come back to this first array using "read from spreadsheet file.vi," I will receive the following table:
    3241713920
    85.88012
    93.88012
    1.735015...
    3241713920
    85.97603
    93.97603
    1.747003...
    3241713920
    84.58855
    92.58855
    1.573568...
    3241713920
    84.48096
    92.48096
    1.560119...
    3241713920
    84.93667
    92.93667
    1.617084...
    If anyone could tell me why this is happening and/or how to fix it, that would be greatly appreciated.  One option I have contemplated is just having each individual row appended to the file instead of resaving the entire array with each iteration.  However, I would prefer to do it the way I am currently doing it, so I can pass the array through each time and perform different tasks on it, such as averaging the values in columns over different time periods.  Thank you in advance to anyone who can help. 

    DWDerr wrote:
    If anyone could tell me why this is happening and/or how to fix it, that would be greatly appreciated.  ...
    This KnowledgeBase article may help.  I think things changed in LV8.20, but I could be wrong.
    =====================================================
    Fading out. " ... J. Arthur Rank on gong."

  • How to write one row of data at a time to "Write to File"

    I am trying to write 10 parameters to the LV "Write to File". This is for just one row at a time. This happens evertime I get a failure in my test routine. I am not quite sure how to accomplish this task. If I get another failure I write one row again. I testing 4 DUTS at a time so I write this row of data to each file. I am sure it is very simple.
    Thanks
    Philip

    Assuming your 10 parameters are an numeric array with 10 elements,  use "write to spreadsheet" file with append set to true. (... and if they are scalars, built the array first ).
    LabVIEW Champion . Do more with less code and in less time .

  • Open Hub: How-to doc "How to Extract data with Open Hub to a Logical File"

    Hi all,
    We are using open hub to download transaction files from infocubes to application server, and would like to have filename which is dynamic based period and year, i.e. period and year of the transaction data to be downloaded. 
    I understand we could use logical file for this purpose.  However we are not sure how to have the period and year to be dynamically derived in filename.
    I have read in sdn a number of posted messages on a similar topic and many have suggested a 'How-to' paper titled "How to Extract data with Open Hub to a Logical Filename".  However i could not seem to be able to get document from the link given. 
    Just wonder if anyone has the correct or latest link to the document, or would appreciate if you could share the document with all in sdn if you have a copy.
    Many thanks and best regards,
    Victoria

    Hi,
    After creating open hub press F1 in Application server file name text box from the help window there u Click on Maintain 'Client independent file names and file paths'  then u will be taken to the Implementation guide screen > click on Cross client maintanance of file name > create a logical file path by clicking on new entiries > after creating logical file path now go to Logical file name definition there give your Logical file , name , physical file (ur file name followed by month or year what ever is applicable (press f1 for more info)) , data format (ASC) , application area (BW) and logical path (choose from F4 selection which u have created first), now goto Assignment of  physical path to logical path > give syntax group >physical path is the path u gave at logical file name definition.
    however we have created a logical path file name to identify the file by sys date but ur requirement seems to be of dynamic date of tranaction data...may u can achieve this by creating a variable. U can see the help from F1 that would be of much help to u. All the above steps i have explained will help u create a dynamic logical file.
    hope this helps u to some extent.
    Regards

  • Save string data type text in the application server file opened in binary

    Hi All,
    My requirement is to save the string "abcd    23432423   asdada" to the text file in the application server.
    I have written like this. but its not getting saved properly in the text file. Please help.
      constants X_LINESIZE type I value 128.
      types X_LINETYPE type X length X_LINESIZE.
    data: WA_TAB_X type X_LINETYPE.
      data: str1(64) type C.
      data: WA_TAB_X_HDR1 type xstring.
      str1 = 'abcd    23432423   asdada'.
      CONVERT TEXT STR1 INTO SORTABLE CODE WA_TAB_X_HDR1.
      concatenate F_FILENAME1 SY-SYSID F_FILENAME2 '/' TAB_REGUT-TSNAM '.TXT' into F_FILENAME1.
      open dataset F_FILENAME1 for output in binary mode .
      if SY-SUBRC = 0.
        transfer WA_TAB_X_HDR to F_FILENAME1.
        loop at TAB_X into WA_TAB_X.
          transfer WA_TAB_X to F_FILENAME1.
        endloop.
      endif.
      close dataset F_FILENAME1.
    Edited by: madhuri sonawane on Jun 2, 2009 4:05 PM

    HI,
    constants X_LINESIZE type I value 128.
      types X_LINETYPE type X length X_LINESIZE.
    data: WA_TAB_X type X_LINETYPE.
      data: str1(64) type C.
      data: WA_TAB_X_HDR1 type xstring.
    data : file (1000) type c.
      str1 = 'abcd    23432423   asdada'.
      CONVERT TEXT STR1 INTO SORTABLE CODE WA_TAB_X_HDR1.
      concatenate F_FILENAME1 SY-SYSID F_FILENAME2 '/' TAB_REGUT-TSNAM '.TXT' into F_FILENAME1.
      open dataset file for output in binary mode .
      if SY-SUBRC = 0.
        transfer WA_TAB_X_HDR to file.
        loop at TAB_X into WA_TAB_X.
          transfer WA_TAB_X to file
        endloop.
      endif.
      close dataset file.
    regards,
    Munibabu.k

  • How to save changes developed with LR to the original photo file?

    Once changes developed I want to save them onto the original file. I export the selected image (original photo + changes) with overwriting choice but the result file has only the original and not the changes

    Presumably we’re talking about something other than RAW files, here, right?
    LR is not Photoshop.  I don’t think you can overwight your original during an Export because it is in use.  LR isn’t really set up to do this, anyway.  LR is non-destructive so it would apply whatever settings it has for an image to the image and display the result for you.  If you overwrote the image, then LR would still apply the settings it had for the original image to the new image with the same name and would effectively be applying the settings twice, which is not what you want. 
    What you probably want to do is export to a subfolder and then re-import those images so what you’ve exported are distinct from your originals.  If you really don’t want your originals after the export, just delete the originals and leave the exported images that you’ve already imported.

  • Capture data and store it in a spreadsheet file

    Hello,
    I want to capture the waveform data from the scope TDS 744A for a specific period of time after a certain interval of time the trigger occurs, store it in a spreadsheet file and then plot the data points in the excel spreadsheet automatically. The trigger should occur as soon as the scope sees some input and after a specific period of time the data is captured and ploted on excel spreadsheet. Can you help me to do this.

    I'm sorry that I don't hav experience with your specific scope, but in general the GPIB commands mirror the operation of the manual controls. If you know how to set up the triggering on the scope manually look for the GPIB commands that do the same things. If you are still having problems in a couple more day and no one is responding to this thread you might want to repost the scope-specific portion of the question being sure to mention "Tek 744" in the subject line. That will increase the likelihood of someone who knows that instrument spotting the problem.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Writing arrays to text data with continious time stamp

    Hi Friends,
    I have the following problem.
    I want to create a text file looking like this:
    12,30,10, 10:30:00     12.05.2007
    12,31,10, 10:30:00,1  12.05.2007
    12,32,10, 10:30:00,2  12.05.2007
    12,33,10, 10:30:00,3  12.05.2007
    12,34,10, 10:30:00,4  12.05.2007
    12,35,10, 10:30:00,5  12.05.2007
    12,36,11, 10:30:00,6  12.05.2007
    12,37,12, 10:30:00,7  12.05.2007
    12,38,13, 10:30:00,8  12.05.2007
    12,38,16, 10:30:00,9  12.05.2007
    12,39,18, 10:30:01,0  12.05.2007
    12,39,18, 10:30:01,1  12.05.2007
    12,39,18, 10:30:01,2  12.05.2007
    the first 3 values are read from a file ,recorded as array and than plotted in chart.
    the beginning time (e.g 10:30:00  12.05.2007) is also read from a file and set as beginning of the chart with a property node. The problem is here , after I set the beginning time to the Chart I have nothing to do with it for the rest values, since samples/sec is also sent to chart.
    So how can I write the a txt file including the time stamp with ms incrementations?
    Thanks alot for your responces.
    john

    Hi John.
    I would use a Time Stamp and "Format Into String" with e.g. %<%.1X>T.
    Syntax details are in the LabVIEW Help - Search for "Format Specifier Examples".
    Regards, Guenter

  • Does anyone know how to save waveform data (Write to Measurement File) with a variant iteration?

    I'm using LV8.5.1

    I would pull your save data loop to it's own loop then make it event driven like I did in the example. This is just an example and there are probably ways to make the code better and faster but I am just trying to give you an example that we can build on. I am not reall sure what you itterations was for other than to give your loop enough time to save. By seperating the two loops the save no longer depends on the data acquisition loop.
    Tim
    Johnson Controls
    Holland Michigan
    Attachments:
    Parts.vi ‏61 KB

Maybe you are looking for