04-03-2008 08:03 AM
04-03-2008 08:14 AM
Hi RZTC Dave,
could this be a solution for you? http://forums.ni.com/ni/board/message?board.id=170&message.id=312737
Mike
04-03-2008 08:31 AM
Thanks Mike.
I don't think those examples apply here. I'm already in a loop with other things going on independant of this. I need something I can turn on and off while the loop continues. I can make an average in a completely dedicated loop. This has to be executable independantly.
04-03-2008 08:42 AM - edited 04-03-2008 08:43 AM
04-03-2008 09:03 AM
I believe that the "Add Array Elements PtByPt.vi" ignores the Sample Length input value if it is not the initial entry into the vi.
The first time the vi is called, Sample Length is read and loaded into a shift register internally. It will only look at that input again if the Initialize input is set to true. Of course each time you initialize the vi, it flushes its previous data.
So I think that the PtByPt.vi is not going to help you here.
04-03-2008 09:15 AM
Jeff
Your example works perfectly until I stop and restart. Any idea of how I can reset the counters to zero when the case goes false? I'll keep tweaking. I like your design because it's achieves the task simply. Yours would work for the first sample period but my users want to change conditions on the fly and average the number in those conditions.
What this comes down to truly is my people not wanting to average their data in excel. As long as it keeps me working I'm fine with it. That's what Labview is supposed to do. Make their jobs easier.
Thanks!
04-03-2008 09:25 AM
Jeff and all.
Got it. It was one of those so simple I can't believe it took me 10 minutes to realize it. I took your design and then in the false case I had the counts subtracting from themselves. This made it always start at zero.
Thanks everyone for your help. This forum is vital for me. I'm on my own here.
04-03-2008 10:42 AM - edited 04-03-2008 10:42 AM
Instead of doing math in the false case, you could just wire zero constants to the output tunnels.
04-03-2008 11:31 AM
Dog gone it. I should have thought of that.
Thank You!