11-13-2010 09:44 PM - edited 11-13-2010 09:47 PM
Hi,
I'm sure this has been asked & answered somewhere but I'm having trouble coming across a good search string to find info on it.
I'm trying to integrate a data collecting array into an existing program that will only write every user defined interval. I understand array basics, but routing the writing through a case structure isn't working with the basic examples I've been able to find. I have a basic program working, but I don't know how good a solution it is. Is relying on local variables too often a bad habit one should avoid?
The random number is just a place holder for instrument generated data. The Wait was just a debugging tool. The false case only sends false to Writing(local variable).
As probably apparent from the above vi, handling arrays is still a weaker part of my labview knowledge and any advice or suggestions would be greatly appreciated.
Thanks,
Lron
11-13-2010 09:50 PM - edited 11-13-2010 10:00 PM
You don't need any of the local variables, they just create additional data copies. Use a shift register instead.
Why don't you attach your VI and we show you how.
If you want to grow the array by one element each time the case executes, use built array.
If you need to write to an indicator in both cases (writing, local of writing), place the terminal outside the case structure! Again, no local variable needed.
11-13-2010 09:56 PM
Here's the vi from previous post.
11-13-2010 10:09 PM
11-13-2010 10:20 PM - edited 11-13-2010 10:20 PM
Very cool, thanks for the help. I see what you were saying about local variables, I definitely would want to limit using them with arrays. They seemed so convenient and reminded me of text based programming that when I found them I felt like aha! something that makes sense.