LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to log data, why is it so hard?

Hello,
 
 Attached is my VI. It is in interface between an omega OMB-DAQ-56 and labview 8.0. Note the express tables, data gets put in there in real time, i want to copy and paste this data as is to an excel spreadsheet. It wont let me do it, i select that data after the test and i cant copy it. I dont know why its so hard to record spreadsheet data.
 
 
I tried to write an lvm file but when i open it using excel it shows me a lot of useless information that comes with the data.
 
    Thanks
 
         - Dan
0 Kudos
Message 1 of 11
(4,015 Views)

I don't see the express tables you are referring to.  I don't know what you mean by copy and paste to an excel spreadsheet.  Where are you copying from?

You should be able to write to an LVM file.  The express VI for "Write to Measurement File" has a lot of options.  You may need to turn off a lot of the outputs like headers so that it doesn't put extra info into the data file.

You have a write to spreadsheet file VI in there that should be able to do the job as well.  Though you have a False constant wired to "append to file".  With this, you would get the data file overwritten on each iteration of the loop.  You may want to put a True constant in there.

0 Kudos
Message 2 of 11
(4,006 Views)
Hello, thank you for the reply.
 
 
   Yes you are right there are no express tables in there, sorry my fault.
 
 
     The latest revision of that VI has a couple express tables in it, basically the express tables fill up with data during the test (the tables are inside the while loop). And then, after the program is finished i want all those tables to go to excel spreadsheets, how do i do that? Can i use 'write to measurement file'.
 
Or,
 
  Even while the program is running if it could write the data row by row to a spreadsheet. It doesnt matter, the former is preferred though.
 
As long as i can get this data in some type of software that allows me to review it later.
 
 
 
One last thing, I tried to create an XY graph of some data. I saw the X input and the Y input and connected my data to it. All i get is an amplitude vs time graph, whats going on? Why isnt it showing a real X vs Y relationship of my data, im not looking for an FFT or bode plot, just a simple real time graph.
 
I've used real time strip charts, but the X axis is 'iteration number' aka 'time'     what i want is the X axis to be something i designate.
Can I do this?
 
Thanks again
 
 
       - Dan
0 Kudos
Message 3 of 11
(3,981 Views)

Write to Measurement File, Export Waveforms to Spreadsheet File, Write to Spreadsheet File, Write Text File can all do what you want. If you want to write as data is acquired, then the write functions belongs inside the loop. If you want to save once, then the write function belongs outside the while loop. The exit tunnel of a loop can be click on and select 'Enable Autoindexing'. This will create an array of all results of all iterations. Don't pass dynamic data out of a loop that way though. Convert to waveform data type first.

The label 'time' on an XY Graph is just that - a label. Use the text tool to change it to whatever you want. If you are not seeing any data in the graph and you are using the Express XY Graph, it's probably because you have not wired a false constant to the reset input. Since you do not have an XY Graph in your program (just like you don't have the tables you talked about), I can only speculate.

0 Kudos
Message 4 of 11
(3,965 Views)

Look, the express tables were added to the program after i uploaded it to the forum, im sure you know what they look like so why state the obvious?

I never said I had XY graphs in my program either, I just asked how to use them.

My main problem is writing data, i am confused as to what needs to go where. I got the program to take data samples but now i need the program to graph different readings with respect to eachother. And write this to an excel file. It is easy to you guys but i am just learning it so bare with me.

 

The 'path constant' block attachs to the 'write to meas' file. Do i put something like this in the path constant: C:/something/somewhere/testdata1.xls  ? note the .xls.

I will put the write meas file inside the loop, the path constant inside as well? and what does append file mean?

 

   Sorry for the newbieness...

 

      - Dan

 

0 Kudos
Message 5 of 11
(3,953 Views)

I understand you are new but if you refer to certain objects in a program and those objects don't exist in the program you post, it's just confusing to someone trying to help you.

Path controls, if you use them, should contain the complete path - including file name and extension. With the Write to Measurement File, you can provide a path name in the properties page and don't need one on the diagram. There are different options for file naming with the express VI. Clicking the 'Help' button will explain the different options.

If you put a path control inside a loop, you can change the path as the VI runs.

Append means this. If you don't append, you overwrite what is already written.

Message 6 of 11
(3,940 Views)


DBFIU wrote:

The 'path constant' block attachs to the 'write to meas' file. Do i put something like this in the path constant: C:/something/somewhere/testdata1.xls  ? note the .xls.



Note that if you use these VI's, you are not truly creating an Excel file, even if you have an .xls extension.  It will just be a text file with .xls extension.  Now Excel will be able to open it because it will recognize it as a text file and will do the import functions to bring it in, and it won't give you any options on how the text file is parsed and interpreted.  And Excel almost always seems to get the import wrong.  It will bring each row and put it in a single cell.  If  you open Excel, then do a File/Open command, it will give you the options to select the delimiters.  Even here, the default options will usually be wrong, but at least you'll have the option to set the delimiters to have it imported correctly.
 
I would recommend not giving the file an .xls extension because it is not a real excel file.
0 Kudos
Message 7 of 11
(3,933 Views)
Ravens
 
So in the end, what should the file extension name be?
 
does it create somewhere/something.lvm ? or should i make it .txt? and then import it to excel and choose delimiting parameters?
 
I guess write to measurement file should solve my datalog problem. If i set it up right that is.
 
One last thing, i am using real time strip charts because those are all i know how to use (thats what came with the omega example program). What is the difference between those and an XY graph? What if i want to plot one set of data against the other in 'real time' while the VI runs, (the strip chart can do that but forces the x-axis to be iteration number i.e time) i want to plot 2 inputs i designate in real time, than how do i save the chart for later review?
 
I guess i should go into the details of what im doing and you guys will understand. I am working on instrumenting a micro gas turbine.
 
4 pressure sensors, 4 temperature sensors a fuel flow meter and a load cell (thrust meter). RPM is also going to be real crucial parameter. What i need the block program to do is plot each of the seperate temperatures and pressures and thrust vs. RPM in real time, about 10 graphs maybe more.
 
Here is the problem, lets say i keep the engine at 80,000 RPM and RPM is my X-axis whereas pressure after the compressor is Y. It will basically plot a whole bunch of data points around the same spot on the graph because the RPM is not changing (the x value remains constant), will that cause the graph to flip out? I wish I could accomplish this, it is so easy to do but i just dont know labview well enough.
 
I read the help file 100 times, the help file in labview 8.0 is not specific at all, it just gives a brief description of what the blocks do, it does not tell me how the inputs should look or what type of data the input needs to be. It gives me examples but those are way over my head at times.
 
Anyway, no more rant.
 
 
      - Dan
 
 
0 Kudos
Message 8 of 11
(3,918 Views)


DBFIU wrote:
So in the end, what should the file extension name be?
 
does it create somewhere/something.lvm ? or should i make it .txt? and then import it to excel and choose delimiting parameters?
 
 


I would recommend either .lvm or .txt.  If it is comma separated values, then .csv.  .xls will work, but I consider it deceptive because it is not a true Excel file.
 
For the graph situation you describe, I would recommend XY graph.  That allows you to build true Y vs. X plots.  But the catch is that you have to build your own chart history by building arrays, (or arrays of clusters) as each point gets added.  With it, you can have multple Y values for the same X value.
 
A waveform chart allows points to be added one at a time and it builds its own history without any extra work from  you.  The catch is that they call the X axis Time, but it is really just an increment of data points.  It won't allow you to have the several Y values for the same X value.
 
A waveform graph is kind of a hybrid between the waveform chart and XY graph.  You have to supply the entire history you want to show each time you update it (like the XY graph, it doesn't maintain its own history.)  However, it only plots waveforms which mean a progression of points across the X axis.
 
You may want to look at the Build XY graph express VI.  It is for true Y vs. X graphs, but has added functionality to let you add a single point at a time and maintain history. 
0 Kudos
Message 9 of 11
(3,897 Views)

Thanks for the help Ravens.

 

Tonight we were able to log data, I saved it as a .txt file and copy/pasted it into excel. I am going to try the XY graph express function soon. It's not super important but it would be nice to be able to choose what i want as the X axis. In any case, I figured it out thanks to everyones help.

Also one more thing,

 

I am using a signal splitter to break up dynamic data. Sometimes the data gets re-ordered completely different through the signal splitter and mixes up my channels and real time formulas. What is going on here? Why doesnt the splitter have some sort of channel label? And what exactly is Dynamic data? I know what its used for but I dont know what it means precisely.

 

Thanks again,

 

       - Dan

 

 

0 Kudos
Message 10 of 11
(3,887 Views)