LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run program continuously and save data

Hi,
 
I am trying to get a program up and running that takes continuous measurements of an oscilloscope and then saves the data to a file.
 
I was able to find vi's from NI that work with my oscilloscope but am having issues getting it to take measurements continuously and am completely lost as to then save those measurements (I am just learning LabView).
 
Attached is my VI, and the readwaveform subvi it calls upon.
 
Any help would be appreciated, thanks!
-Pat
Download All
0 Kudos
Message 1 of 8
(8,325 Views)
In order to take data continuously and write it to file you actually need to be running the VI continuously. You're not doing that since you have no loop. The "Run Continuously" button in the toolbar should not be used, if that's what you were doing. That's intended for specific debugging situations. You need a while loop and inside the while loop you call the VI to read the waveform. If you need to save the data at each iteration, then call the file write function appropriate for the way you want to save the data.


To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.



Message Edited by smercurio_fc on 04-25-2008 01:29 PM
Message 2 of 8
(8,314 Views)

The first thing is that you don't have anything in that program to operate continuously. DO NOT use the run continuous button on the toolbar. I can't save your VI back to 7.0 so I've attached an image. There is a while loop around the scope read and some functions to get the data and save it as a text file. I did not make this very fancy and you will want to add a path control/constant so that you don't get prompted for a file name all of the time. It's also not extremely fast since it saves data as text.

See http://www.ni.com/academic/lv_training/how_learn_lv.htm for resources to learn LabVIEW.



Message Edited by Dennis Knutson on 04-25-2008 12:39 PM
Message 3 of 8
(8,299 Views)

Hey guys,

Thanks for helping, it works now and saves it.

I have one final question.  Is there a way to get LabView to save all the data in one file without it rewriting over the previous data so that it is just a continuous stream of data that saves start to finish until the program is stopped?

 

Attached is my updated VI

 

Thanks again, it has been so much help.

-Pat

0 Kudos
Message 4 of 8
(8,282 Views)

Hi preilly,

connect a true constant to the "append to file" input. Smiley Happy

Mike

Message 5 of 8
(8,278 Views)
on the bottom of your file write VI there is an input asking if you want to append to an existing file (T) or overwrite any data (F).  if you wire a true constant to it, you will append all your data.
 
edit - gah, beaten!


Message Edited by JeffOverton on 04-25-2008 03:18 PM
Message 6 of 8
(8,277 Views)

Ahha, that was an easy fix.  Thanks all!

-Pat

0 Kudos
Message 7 of 8
(8,269 Views)
also, you should use a control to stop your program to ensure your last data point is written.  it will go true and trigger the loop to stop iterating, so all data writes will happen.  if you just use the stop button in the development environment you could potentially interrupt any data transfer, as well as potentially leave instruments hanging.
0 Kudos
Message 8 of 8
(8,266 Views)