Read from Measurement File Express VI - Time information

I need some assistance with a small problem with building reports of collected data. I don't see it very relevant, but I'm collecting data from several modules on a 9074 cRIO. I'm not using the cRIO the way it is intended, but it is perfect for my needs. Anyway, I'm collecting the different types of data in RT, then using the express VI "Write to Measurement File" with TDMS option selected and one time column only selected. Also one header, etc. Nothing fancy.
In another VI I want to use this collection of .tdms files to create an Excel report. Everything is working good however I need a time column for reporting my data. When I view the .tdms file using Excel Importer, the time column is there and perfect, with the next column a relative time (or iteration) and then columns with the signal names at top and all the data below. Perfect.
I'm similarly using the "Read from Measurement File" Express VI to get the data back the same way it went in. I have everything in it's correct place on building the Excel Report, but I haven't been able to find any way to include the first time column in my import. I can use "Get Attributes" Express VI to get the signal names from the read, but that's not going to help with the time data. How is it possible that Labview allows to put the time data there, but not retrieve it? I'm aware of the warnings that Timestamps aren't supported by TDMS file format vs LVM, but there MUST be a way to retrieve that time information if "Excel Importer" can do it.
If that time column in the TDMS file is somehow computed using the start timestamp and dt, can someone explain how to compute that for my report?
Unfortunately, I can't use the LVM format because I need to allow the users of these VI's the backup of using Excel Importer to see this data if my report generation VI is not functional.
I'll attach one of the TDMS files for illustration. The first column of the second worksheet is exactly the data I need for my report.
Attachments:
TDMS Imported.xls ‏28 KB

DylanC,
Your solution works as needed. Thank You.
I think I found a better solution though. Apparently if you convert a signal from the Express VI "Read from Measurement File" into a waveform the time data required is included, then you can convert to a string with a for loop and insert it as a row header into a table. The result gives me what I need. I attached a screenshot if someone is interested.
AWyers
Attachments:
TableFromTDMS.JPG ‏61 KB

Similar Messages

  • Data reading and writing problem? how to set " Read from Measurment File express.vi​" 's readout datasize?

    Dear all,
    I want to use Labview to process a data.
    Now I have a array in a text file.
    this array is very very big. which is at least row*col = 6 * 100000;
    the column size always 6,
    but the row size is ramdom, some times is very big, like bigger than 65535,
    when I use "read from measurement file express.vi" to read this file, the array I could get always 6*5339, I don't know why. the column size is always 5339.
    and then I delete the 1st row of the array and then write into a txt file via "write measurement file express. vi", it takes a very long time. almost computer has no response. after a while, no file was creat to record the data.
    is there an efficient way to process such big data file and store the processed file into a new file
    thank you very much
    Jack
    Message Edited by weichengatech on 03-09-2006 12:00 AM

    Hello,
    There’s no real efficient way to read the file if you don’t
    know exactly how many rows of data you have. 
    Your going to just have to read a row at a time and add the results to
    the end of an array (granted for the clever programmers there are some more
    efficient ways to do this than just with ‘build array’).  I would start by asking you how much
    information you know about the file and what the exact structure of it is (i.e.
    is it a binary file, a tab delimited file, or a LVM file)?  Could you provide a screenshot of the code
    you are running? If you provide a little more information on the file structure
    we might be able to contribute some additional information.
    Look forward to hearing back from you-
    Travis M
    LabVIEW R&D
    National Instruments

  • Read From Measurement File... removes X Values of first column?

    During one of our tests, two instruments were switched at the terminal by accident. I need to read in the massive lvm files, remove the wrong scaling and apply the correct scaling, while switching the values in the columns and right it all to new files. Simple right?
    I wanted to use the Read from Measurement File.vi to make things easier, because the files are very large and I would like to analyze them 100 rows at a time. Some of the the files are around 1.5 Gigs in size so I need to read them in chunks.
    The read from measurement file keeps removing the first column from the data! It outputs the data as a signal (dynamic data) and I have to use the dynamic to numeric array express vi. For some reason, before I even get to that point, the first column is not in the data.
    No matter what settings I pick on the read from measurement express vi, the time column is removed from the data. I have checked/unchecked the "first row is channel names" and "first column is time channel" to no avail. The odd thing is that in the preview it shows the first column, as if it will read it properly... but it doesnt. Nothing I change in the settings can seems to make a difference in getting the first column, the x values, out of the file.
    Below you can see the first column completely removed from the data.
    This is extremely frustrating. By probing the signal out I can see the dynamic data attributes and the time column has already been removed, so I don't think that the signal to double array express vi is the problem, but I am not sure.
    I am attaching my VI and a small data file to be analyzed. You can see what I mean.
    The alternatives seem less than adequate. The read from spreadsheet file vi wants an offset of a specific number of characters not rows. The problem is that this is not constant between rows for some reason, when hidden characters are taken into account so I cant just set the number of characters in 100 rows and increment the offset in a loop... like I normally would. That means I might miss data or get a corrupted row.
    This means that I have to use the read from text file, read how ever many characters I think a row is (over estimating a bit) then search for the newline character, find out how many chars are in that set and then offset that for the next loop iteration, all while converting each string number to a double. Talk about slow.
    I have searched around and found that I am not the only one that has had this issue. This is a common thing, but no one seems to have the answer. Why can't the read from measurement file VI read all of the numbers in every row? Why cant I tell it I want a 2d array of doubles out and not a dynamic data type? It has to be something I am doing wrong.
    Attached is a zip file with my VI and two data files. The "S19_A_DSI_detensioning_c.lvm" is the one generated by my VI (_c meaning corrected). "S19_A_DSI_detensioning.lvm" is the original measurement file. I hope you will pardon my messy VI, it's a quicky.
    Any help you guys can give would be much appreciated.
    [will work for kudos]
    Attachments:
    Scaling Factor Correction.zip ‏1109 KB

    That is a great workaround. The help talked about putting a check next to "read lines" but for the life of me I couldn't find where to do that. I wonder what other VIs have mystery check options in the right mouse click menu. I mean normally options like those are inputs, I thought. I'm going to start right clicking on every VI I drop to see if there are options there I never realized.
    I would still have to use the set file position VI and specify the byte offset right? How would I know where that is? I guess each character is a byte and I would count the characters in the string retrieved and then offset by that amount on the next iteration using a shift register?
    While waiting for help, I ended up using the read from text file and using the match string to look for the new line character, and using the spreadsheet string to array vi, analyzed the files line by line. Thats just because I couldn't easily come up with a regular expression to get 100 lines. It was slow but it worked.
    However, that still really doesn't answer the question of why it is impossible to get the first column with the read from measurement file express VI. Does anyone know? Is this a known bug?
    [will work for kudos]

  • Read from Measurement File to XY on Waveform Chart

    Something pretty simple that is giving me a hell of a time right now.
    I've got a .lvm here that has been saved from a DAQ and has one column of numbers starting from 0.0000 - 27.0000 in very small steps. The next column is amplitudes of the signal at the given time. Now, from this LVM file I'm starting a new vi and I want to read those values as X and Y and get them onto a waveform chart. As of right now I've tried hooking up "Read From Measurement File" and tried "Build Table" but that won't want to plug into a chart. Plugging the file directly into a chart causes two very different lines to show up but is no where close to what I'm looking for.
    Any tips as to how to complete this?
    Solved!
    Go to Solution.

    Tasty,
    More often than not I find Express VIs to be more trouble than they're worth. Here's an example of reading tab delimited data in from an .txt and plotting Y values versus X values on a graph. Hope it helps.
    Andrew
    Andrew
    Attachments:
    ReadData.vi ‏14 KB
    data.txt ‏1 KB

  • "read from measurement file" reads only first line of data

    Hello,
    I have a problem when trying to read a .lvm file through "Read from Measurements file" with the following block diagram
    Problem: it reads only the first line of data from what I can see in the probe window,.
    A part of the lvm file for reference.
    I haven't used Labview in a long long time, I'm trying to figure out what I am doing wrong.
    Thanks

    Sorry meant to attach the lvm. Here it is. (Actually I had to put it in .txt because the forum wont let me upload a lvm file)
    I unfortunately cannot share the full vi that record the data as I am not its owner/creator. I'll try to give as much info as I can with the relevant pictures attached, I hope it allows us to at least have an hint of where the problem might be.
    (this is in a while loop)
    In the stacked sequence, the other pannels are similar to the one shown here: value read fron a variable, converted to dynamic and a signal attribute is set. The "start recording" control operation is "switch when pressed".
    Here are the properties of the set signal attributes
    And here are the properties of the "write to measurement file"
    Attachments:
    NoTarget_full circle__Rx_-10-SAMPLE.txt ‏60 KB

  • Read LabVIEW Measurement File VI Multiple Times

    I Get Error 4 When Calling the Read LabVIEW Measurement File VI Multiple Times. I've searched and found a paper on this issue. http://digital.ni.com/public.nsf/allkb/0576444C8FD4DC0F86256E83007FA540
    So I have a question: Is there a way to fix this to I can still Calling the Read LabVIEW Measurement File VI Multiple Times?
    Thank you.
    Attachments:
    Error 4.vi ‏33 KB
    data.zip ‏258 KB

    The paper you linked makes it very clear. The Read File Express VI cannot do what you want.  Either use the low level File VIs and functions or open the front panel of the Express VI and then modify it to do what you want. Most likely the Express VI uses the low level file functions internally, but it may have a lot of extra code to handle special cases. It is probably easier to use the low level functions and you learn how to use them.  
    Look at the Examples under Fundamentals >> File Input and Output. Something there may do most of what you want and even if it does not, the exampels will help you learn how to use the file resources in LV.
    Lynn

  • Read from measurement file (wrong values)

    I have a VI where I save data using the ''Write To Measurement File utility''. When I open the .lvm file in the note pad I can see all the data correctly, but when I use the "Read From Measurement File" tool and try tho make a graph the data shown is not correct. Attached the .lvm file and one image of the chart that labview made using the "Read From Measurement File". If you open the lvm in the notepad you can see that the time column goes up to  22 sec. In the chart the time axis goes only up to 7,5 sec. What is going wrong??? Thanks
    Ps: I changed the file .lvm to .txt to attach
    Solved!
    Go to Solution.
    Attachments:
    Chart.jpg ‏688 KB
    teste.txt ‏156 KB

    vitor22 wrote:
    I tryed.
    And how did it turn out?  Saying I tried and not saying how it didn't work doesn't help me help you.
    I was able to do it.  But the X data wasn't correct.  That is because your timestamps aren't regular spaced.  So you can't use a waveform graph.
    You need to use an XY graph.  See the attached code for how to convert the two channels of data (time, your values) into a datatype to feed to the XY graph.
    Attachments:
    Example_VI_BD.png ‏49 KB

  • Read from measurement file problem

    Hi all,
    I am using the "Read from Measurement File" VI that is built into LV8. I am reading in a .lvm file consisting of 2 columns. I cannot seem to figure out how to index each column. When tested using a a single column data file, I am able to use the index array vi to  access the data successfully. The problem occurs when I have 2 columns. To get around this problem I split my initial data file into 2 single column data file, but I would prefer not having to do this. Is there anyway to avoid this?
    When I read the 2D file into an array I can only index the data located in the 1st row 1st col and the data in the last row 2nd col.
    The array size function results in the value "2" yet each column has 201 entries.

    Attachments:
    Write to LVM.vi ‏128 KB
    To read LVM.vi ‏70 KB

  • Using Scanner and FileReader to read from a file in real time

    Hi
    I would like to read continually from a text file (which is continually being appended to) and display each line as it appears in the textfile (in a text area).
    What I would like to know is do I have to continually reopen the file (using FileReader) and buffer it into a Scanner everytime I want to read the changes made to it? There must be a better way.
    Much appreciation for any help.

    Umm .. I hope you're doing that in a separate worker
    thread as otherwise you would block the EDT from
    processing events like paint (thus never showing you
    anything you append to the text area).Well that code fell under the run method of a class that is seperate to the main class, so it was called in a new thread. In desperation I've tried calling threads within threads (dangerous I know): remoteHandler's run method is called by a JButton's action listener...
    private class remoteFHandler implements Runnable {
         int lineNum;
         int  win, x, y, count, num = -999;
         remoteFHandler(){
              lineNum = 0;
         public synchronized void run() {
              while(showScreen == true){
                   readingRF = true;
                   innerHandler read = new innerHandler();
                   Thread t = new Thread(read);
                   t.start();                      
         //Wait 5 a seconds before checking if there is anymore text
                 try {
                         textArea.append("Waiting to reopen \n"); //DEBUG
                   t.join();
                   wait(5000);
                 } catch (InterruptedException e){
                   System.out.println("File reading interrupted");
                   return;
                }// while
              readingRF = false;
              return;
         } //run()
         private class innerHandler implements Runnable{
              innerHandler(){
              public synchronized void run(){
                   try {
                        outFile = new File("/data/wrmwind_08/testText.txt");
                        if (outFile!=null) textArea.append("File last modified: " + outFile.lastModified() + "\n"); //DEBUG
                        fs = new Scanner(new BufferedReader(new FileReader(outFile)));
                        if (fs!=null) textArea.append("File opened stream \n"); //DEBUG
                        fs.useDelimiter("\\r");
                      } catch(IOException e){
                        System.out.println("Problems opening file. IO exception: " + e.toString());
                        return;
                      if (fs!=null){
                        readAndDisplay();
                        fs.close();
                        fs = null;
                        if (fs==null) textArea.append("File closed \n"); //DEBUG
                   return;
         }//innerHandler
            private void readAndDisplay(){ //reads from a file and displays in a text field until there are no new lines  then returns
         }//readAndDisplay()
    }//remoteHandlerThe strange thing is that the when I modify the text file while the program is running, that time of last modification is detected and displayed in the text area yet I can't get to read the new line that's been added....

  • How do I read from a file and store the information in an array?

    Here is my problem:
    I am going to have to use a bufferedReader to read a file containing information on 10 vehicles. And after I read that file I want to store the info in Vehicle [] V.
    Where should I start?
    Thanks
    Steve

    Thank you for the quick response.
    As of right now our code is the same. Now I have to "parse" the information. What exactly do you mean?
    My code is as follows:
    while((str = br.readLine()) != null)
    String[] tokenArray = str.split(" ");
    for(int i = 0; i < tokenArray.length; i++)
    System.out.print(" Token: " + tokenArray);
    System.out.println("\n");
    Is that what you mean by parsing?
    I am not quite sure what e slpit(" ") is doing. Is there a better way?
    And just to make sure I am understanding my own code, I am storing the information from the br in tokenArray. Followed by a series of print statements which output the info.Correct?
    Thanks again,
    Steve                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Labview 8 crashes when using Read Labview Measurement File

    Hi All,
    I am a new user for Labview. I installed Labview 8.0 from the CD (evaluation copy). I was just testing the sample code provided by NI. I opened the "Load from File and Display" example and I was trying to open the properties for the Read Labview Measurement File component when Labview crashed. I tried it a couple of times and everytime it happens the same way (when I double click the component or right click on it).
    I am using Windows XP with all the updates done. In the Windows crash report, the application version is 8.0.0.4005.
    Other problem I encountered is a missing component on the Input Palette (no DAQ Assistant present) and the Instrument I/O Assistant raises the error "Measurement & Automation Explorer or the Instrument I/O Assistant is not installed correctly. Please install these from the Labview Driver CD". For the last problem, I will try to run the Labview Driver CD, once I get it. But I am not sure if the DAQ Assistant will show up then or not.
    Any ideas?
    Regards,
    Nick

    Hello Nick,
    While it is not my area of expertise, I would expect the DAQ Assistant would appear after installing the driver CD as you said you would be trying.
    What caught my attention was the crash.  The easiest way to resolve the crash is to delete the instance of the Read LabVIEW Measurement File on the diagram and place a new one from the Express Input palette (now called "Read From Measurement File").  In that situation, I would expect just pressing OK to accept the default configuration should work.  The crash occurs in certain circumstances when the Read / Write Measurement File Express VIs are dropped from a previous version of LabVIEW and then their config page is opened in 8.0.x.  This issue should be resolved in a future release, sorry for the inconvenience.

  • Read from text file takes very long after the first time

    Dear LabVIEW experts,
    I'm having a problem with read from text file. I'm trying to read only every nth line of a file for a preview with this sub vi:
    I seems to work well the first time I do it. The loop takes almost no time to execute an iteration.
    Then when I load the same file again with exactly the same settings one iteration takes around 50ms.
    Subsequent attempts seem to always take the longer execution time.
    Only when I restart the calling vi it will be quick for one file.
    When executing the sub vi alone it is always quick, but I don't see how the main vi (too complex to post here) could obstruct the execution of the sub vi.
    I don't have a the file opened elsewhere in the main vi, I don't use too much memory...
    Right now I don't now where to look. Does anyone have an idea?
    Regards
    Florian
    Solved!
    Go to Solution.

    I don't know the LabVIEW internals here, but I would think that it is quite possible that closing a file opened for read/write access writes a new copy of the file to disk, or at least checks the file in order to make sure a new file does not have to be written.
    Therefore, if your main VI calls this subVI sequentially (you don't give any information about the place of this subVI in the main VI), you are actually looking at a close (check/write) -> open operation for any time you call it, as opposed to a simple open operation the first time. If you were to open the file for simple read access (since that's all you do), it should work fast every time because there is no need to check to see if it has changed.
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ

  • Time format in 'Write To Measurement File' express vi

    Hi,
    I'm using the 'Write To Measurement File' express vi to save data acquired using a PCI-6221 board and the DAQmx vi s. The acquisition is continuous.
    When I set the 'number of samples per channel' property of the DAQmx Read.vi to -1 (ie, read all available samples), the time is saved in relative format. When I set any other value (ie a certain quantity of samples), the time is saved in absolute format.
    Do you know why the vi does this, and if there's any way of controlling the time format ?
    Thanks,
    ps : I use Labview 8.0 

    Hi Scalpas,
    I look into what I believe you are doing , but I didn't see the same results. Can you explain what datatype you are transferring to the Write to Measurement file VI? Or provide a sample of code that demonstrates the issue.
    I think it might have to do with the DataType conversions when writing that file.
    Sappster

  • Reading from a file. How to ask the user for file name at run time????

    I have the code to read from a file but my problem is how to prompt the user for the file name at run time.
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.util.InputMismatchException;
    import java.util.Scanner;
    public class FileRead {
        public static void main(String args[]) {
            Scanner scan = null;
            File file = new File("Results.txt");
            String number;
            try {
                scan = new Scanner(file);
                while (scan.hasNext()){
                number = scan.next();
                System.out.println(number);}
            catch (FileNotFoundException ex1){
                System.out.println("No such file");
            catch (IllegalStateException ex2){
                System.out.println("Did you close the read by mistake");
            catch (InputMismatchException ex){
                System.out.println("File structure incorrect");
            finally{
                scan.close();}
    }Any hints would be greatly appreciated. Thank you in advance

    I have read through some of the tutorials that you have directed me too and they are very useful, thank you. however there are still a few things that i am not clear about. I am using net beans 5.0 I have placed a text file named Results.txt into the project at the root so the program can view it.
    When I use the code that you provided me with, does it matter where the file is, or will it look through everywhere on the hard drive to find a match?
    This code compiles but at run time it comes up with this error
    run-single:
    java.lang.NoClassDefFoundError: NamedFile
    Exception in thread "main"
    Java Result: 1
    BUILD SUCCESSFUL (total time: 3 seconds)
    import java.util.Scanner;
    import java.io.*;
    class NamedFileInput
      public static void main (String[] args) throws IOException
        int num, square;   
        // this Scanner is used to read what the user enters
        Scanner user = new Scanner( System.in );
        String  fileName;
        System.out.print("File Name: ");
        fileName = user.nextLine().trim();
        File file = new File( fileName );     // create a File object
        // this Scanner is used to read from the file
        Scanner scan = new Scanner( file );     
        while( scan.hasNextInt() )   // is there more data to process?
          num = scan.nextInt();
          square = num * num ;     
          System.out.println("The square of " + num + " is " + square);
    }his is the code that i used. It is the same as the code you posted for me (on chapter 23 I/O using Scanner and PrintStream) Sorry im just really stuck on this!!

  • When I try to install Itunes, I get this error: (translated from Norwegian) There was a network error while trying to read from the file: C: \ windows \ installer \ iTunes.msi I have tried many times to reinstall, but nothing helps, please help me.

    When I try to install Itunes, I get this error: (translated from Norwegian) There was a network error while trying to read from the file: C: \ windows \ installer \ iTunes.msi I have tried many times to reinstall, but nothing helps, please help me.

    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    (2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

Maybe you are looking for

  • LOG FILE for batch scripting in MAXL

    Hello, I just wanted to know how to create a LOG FILE for batch scripting. essmsh E:\Batch\Apps\TOG_DET\Scripts\unload_App.msh copy e:\batch\apps\tog_det\loadfile\gldetail.otl e:\hyperion\analyticservices\app\tog_det\gldetail /Y essmsh E:\Batch\Apps\

  • RAID Utility does not work after Vista upgrade

    Hi, I have a Qosmio G30 with 2 HD 120GB each. After I upgraded to Windows Vista from Windows XP, the Toshiba RAID Utility does not work anymore. In WXp it worked OK, but in Vista there is no way I can mirror the HD. That is, the utility itself work,

  • How to get the size of partition?

    The following SQL will get the rows of the fact table & aggregation. But how to get the size (MB) of the partition. select * from $system.discover_partition_stat That should be doable, because in BIDS, we can see the size of a partition, but from whi

  • My URL bar is gone. I can't type in URL's there is no where to do it?

    I have no URL bar?

  • How can we improve Apple service?

    Well meaning Apple staff are being disempowered by the rigid customer architecture and poor customer support systems. How can we help Apple become more customer focused before it losses its long time brand advocates?