LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sampling time increased when arrray loop added.?

OK, here's a simple question: What in the world are you trying to do with that for-loop in the first place? You had two issues with this program: (1) the "sampling time" was greatly increased, and (2) no data to file. The "sampling time" is affected by that for-loop since you are executing that loop each time you acquire data. That loop is set to run 1000 times with a 10 msec delay, so you've added a 1000*10msec = 10 second delay after each reading. Of course that's going to affect your speed. So I go back to my question: what are you trying to accomplish with this loop, because I can't figure it out - you're getting the mean, min and max of the same number 1000 times. ???

As for (2) - The only way to stop your acquisition loop is to use the ABORT button on the VI's toolbar. This effectively stops your program in the middle of the loop and the write blocks never get executed. You have to use a front panel boolean control to stop the loop so the rest of the VI can execute once the loop stops.

Message Edited by smercurio_fc on 02-20-2006 02:22 PM

Message Edited by smercurio_fc on 02-20-2006 02:23 PM

Message Edited by smercurio_fc on 02-20-2006 02:23 PM

0 Kudos
Message 11 of 17
(723 Views)
N is the numner of times to run the loop.  Less loops will run faster.  Don't know what you are doing in this loop so can't help much. 
Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 12 of 17
(719 Views)

i got help from someone here about the loop, so its not my idea.

basically i want to calculate the mean power generated over time as well as the others (power, current etc).

from all the threads here i think this is pretty much impossible or no one understands what i want to do. i want to get the mean of ALL the values coming through, not just the most recent one. i thought this for loop was doing this, but it seems not. when i get all the mean values i just send them to excel and plot a graph of mean power vs time. thats all i wish to do but seems impossible.....

i have no idea how to go about this,

0 Kudos
Message 13 of 17
(709 Views)
I'm guessing you probably misunderstood what they were saying as far as the loop. OK, I think I understand what you're trying to do. The only remaining issue is if you're looking for a post-collection mean/min/max value set or a running statistic. I'm going to assume you want a post-collection as that's the easiest to code up. I created a simplified version of your VI to show you one way of doing this. I replaced the serial port stuff with two random number generators. The loop continuously acquires data until you click the STOP button on the front panel. The collected data is saved to file, and the mean/min/max values for each array is calculated and saved. You can change the way this data is packaged and saved as you see fit.

Message Edited by smercurio_fc on 02-20-2006 03:32 PM

0 Kudos
Message 14 of 17
(703 Views)

cheers, i will look into this one now.

 

thank you, what i wish to do seems easy, but i find it impossible to implement.....

i will let you know how i get on.

 

 

0 Kudos
Message 15 of 17
(698 Views)

if you see my earlier thread, i have an excel spreadsheet with volts,current and power vs time.

i want the same as that for the mean, so it will be mean vs time.

 

so i guess it will be in real time, sending all the data as it happens and then saving it.?

in your ammended vi do i put my sequence instead of the dices and put my volts and current there?

 

 

i have had so many different solutions for this, like use shift counters, arrays, this ,..that.....¬?!!

 

 

0 Kudos
Message 16 of 17
(695 Views)
Yes, you would just replace the sequence frame that I put in with yours that does the serial port reading.

I took a look at your data and I did not see a difference between the data in the "mean.xls" file and the "power" column in the "power.xls" file - these columns contain the same values. Am I missing something?
0 Kudos
Message 17 of 17
(687 Views)