LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save data with a button and...

My program is able to take inputs from  two function generators... and it plots the data onto a XY plot AND onto an intensity graph  (256x256).

It is also saves the data from the intensity onto CSV files... like one CSV file per second... so after running it for a minute i already have 60 files.  BUT that is NOT what I want.  I don't want CSV files of the data of every single second! 

What I want in the end is the following: (1) have two buttons: "Snapshot" and "Save" (2) when "Snapshot" is pressed, ONE CSV file i screated for that given moment. (2) "Save" can be turned on and off, when on, it save every single second.  (3)  I can use "Snapshot" when save is on OR off.

Current Problem:  I have a save button that saved everything when it was on and the graphs would update continuously.  that was good.  BUT the problem occurs when the save button was turned off, not only did the CSV filing saving stop, the graphs also stopped updating!!!  the graphs only updated when the save button was turned back on.

thus i went from saving every second and the graph updates continuously(not really), but it is good, I just don't want to save every file.  but now the graph ONLY updates when the save is on... that's no good.

attached are two VI's.  one saves all the time, and the other is the one that does not work the way i want it to.

0 Kudos
Message 1 of 9
(10,988 Views)
here is the other vi...
0 Kudos
Message 2 of 9
(10,988 Views)
any help is welcome!

Message Edited by engineer2450 on 07-23-2007 05:48 PM

Message Edited by engineer2450 on 07-23-2007 05:48 PM

0 Kudos
Message 3 of 9
(10,972 Views)
The first problem with this is that because the data is coming from outside the data saving loop, you are simply resaving the same data over and over again. Get rid of the inner while loop and you will save the last data to be read. If you put a case structure around the data saving code you can use the Save button on the front panel to determine whether or not to save the data.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 9
(10,965 Views)
Yes, you are right, I need to figure out how to use a case structure for this case.. that's my problem.  But you got one thing wrong.  Even though the save in inside the while loop, it does not save the same data over and over again becuase once the loop is finished, it goes back outside and the graphs update and the csv's are written correctly.  But that is not what I want.
0 Kudos
Message 5 of 9
(10,948 Views)

Case statements are pretty simple. You can take some of the tutorials at http://www.ni.com/academic/lv_training/how_learn_lv.htm to learn the basics of LabVIEW. With two buttons, all you need is an OR function. This is on the Boolean palette. The button that you want to use for continuous save, you can use the switch when pressed mechanical action. The snapshot Boolean can be set for Latch When Released mechanical action. You set the mechanical action from the front panel by right clicking on the control. There is additional information in the on-line help about mechanical action.

Message Edited by Dennis Knutson on 07-24-2007 09:25 AM

Message 6 of 9
(10,945 Views)
thanks dennis, this part of my program works perfectly now!
0 Kudos
Message 7 of 9
(10,921 Views)

hello,

 

i need to save a data from oscillscope ( photodetector signal to oscilloscope)  for a duration around 2 hrs contionusly.. can you please help me how to save the data...and plot the graph...i have ni pxi 5105 digitizer, and ni pxie 1082...

thanks in advance...

0 Kudos
Message 8 of 9
(6,441 Views)

@sjumesh wrote:

hello,

 

i need to save a data from oscillscope ( photodetector signal to oscilloscope)  for a duration around 2 hrs contionusly.. can you please help me how to save the data...and plot the graph...i have ni pxi 5105 digitizer, and ni pxie 1082...

thanks in advance...


That has nothing to do with this thread.  Please start a new thread.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 9
(6,421 Views)