02-21-2006 12:42 PM
One way to save data outside the loop is to right click on the exit tunnel of the while loop and select Enable Indexing. This will create an array that contains all of the readings.
Yes, Excel can calculate the mean, but then so can LabVIEW. I've attached a modified version of your program. It takes the mean of each measurement, appends that to the end of each array, creates a 2D array from both, and then writes all data to a spreadsheet file.
02-21-2006 12:52 PM
thats great, im still fiddling with this, i will look at your one now. cheers, looks like im finally getting places.
02-21-2006 01:01 PM
i have a set up like you posted, however im getting nothing past the loop, with indexing enabled. the current and power are all there inside the loop though.......?
02-21-2006 01:18 PM
02-21-2006 01:22 PM
well, i put all your code inside the loop, but it asks me to save every cycle. i want to send everything to one excel file in a go. can i hook up the measurement block to the end of the 2 arrays you have gathered up and get the mean that way?>
it doesnt really matter if its inside or outside the loop does it?
02-21-2006 01:27 PM
NowI'm really confused. The code you posted had a single while loop. Are you saying that you then put that inside another loop? Post this modification if can, please.
The mod I made took the mean of all of the current measurements and the mean of all of the voltage measurements. What exactly do you want to take the mean of?
02-21-2006 01:57 PM
here is the vi, i just put a measurment vi onto the array output, i was monotoring the data of the array and it was the same as what was coming out of the power string........?
the reason it asked me to save every time was cos i had it inside the loop, but i couldnt get it to work outside the loop.....?! or else it was working but i didnt know it as i saw no activity.
02-21-2006 02:16 PM
This isn't correct either. You convert a scalar value to an array and then take the mean of it. Because the array will only have a single value, the mean will just be the scalar. You have to do the mean outside the loop or build up an array with a shift register and take the mean each time.
As I said, auto-indexing should work just fine and you can do a single file write and mean calculation outside the loop. If you expect to see activity outside the loop with a probe, you won't untile the while loop finishes, as I also mentioned.
02-21-2006 02:43 PM
02-21-2006 02:58 PM
i used your idea, everything outside the loop, but again, nothing get saved, just like before......whats happening? freakin hell....!
thats why i shoehorned everything in the loop before.
what do you think?