LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

saving to spreadsheet after stopping a while loop

Solved!
Go to solution

Hello,

 

I am writing a program that generates an analog signal, transmit it to Schmitt trigger, then puts out the original signal and the trigger signal into a waveform chart. It then must output a series of data as a spreadsheet file after the loop is stopped. 

 

I've gotten the thing to output a waveform chart and stop it with a button, but I can't output it as a spreadsheet file. What should I do? I've arrayed both sets of output into 1D array, but after pressing STOP it won't do anything. If I stick the save to spreadsheet vi into the while loop, the save prompt triggers, but after only the initial iteration.

 

The "noisy analog" is a signal generator using a function, which is rendered into a subvi and imported into untitled 1. 

Download All
0 Kudos
Message 1 of 5
(2,354 Views)

You did not attach a VI with the write outside the loop so it is impossible to say what you did incorrectly. The current VI creates a new file each iteration so that will not save anything except the last value. You will get the prompt for a file name each iteration

 

The simplest thing is to pass the array out of the loop and enable auto-indexing on the exit terminal. Simply right click on it and select 'Enable Indexing. Or, fix the write function when it is inside the loop to not create a new file and not prompt for a file name each time.

0 Kudos
Message 2 of 5
(2,343 Views)

I've passed the array to the outside of the loop, enabled indexing, but again it does nothing. Any ideas? I've also tried linking into a select but it really just refuses to write to spreadsheet. 😞

Download All
0 Kudos
Message 3 of 5
(2,332 Views)
Solution
Accepted by topic author GabrielleD

You've got a stop function inside your subVI. No point at all in having that.

Message 4 of 5
(2,318 Views)

It worked! Thank you!!!!

0 Kudos
Message 5 of 5
(2,315 Views)