03-01-2010 11:28 AM - edited 03-01-2010 11:29 AM
Don't worry, Alan! We're not going to yell at you for posting some code that is entirely relevant to the original discussion. And congratulations on your CLAD!
I think you missed part of the problem statement...the OP wanted only the last 5 elements of the generated array. Also, as an example of a possible "stop" condition, the loop would stop when the random number generated had a value of, say, 9. You can just use a "Stop" button for your "stop" condition.
So your VI doesn't solve the problem. If you want to try again, here's some advice:
1. It's going to be easiest to pre-allocate a 5-element array to work with, so as to get the output array size correct.
2. You'll need some way of eliminating the older elements as the loop iterates, so that the array size is always 5
3. You'll need some way of inserting each new element at the beginning of the array as the loop iterates
Possible approaches suggested during this thread were:
1. Use of the "rotate array" function in conjunction with the "replace array subset" function
2. Use of the "delete from array" function in conjunction with the "insert into array" function
3. Use of shift registers
4. Use of a "lossy queue" function.
Any of those approaches will work well. Give it a try!
d
03-01-2010 11:36 AM
That was it?
You mean that's all the person wanted?
And it exploded into this long thread?
I thought I had missed something in the interpretation and it was something more complex.
w-o-w ... 😐
Oh well.. you can't win 'em all...
03-01-2010 11:48 AM
Um, yes.
That's all.
Instead of trying out any of our suggestions as to how she might approach the problem, she threw a fit. She also took exception to the fact that we wanted her to write her own code.
Ah well!
03-01-2010 12:09 PM
Ray.R wrote:That was it?
You mean that's all the person wanted?
And it exploded into this long thread?
I thought I had missed something in the interpretation and it was something more complex.
w-o-w ... 😐
Oh well.. you can't win 'em all...
Yeah, when you actually looked at it was a trivial problem.
03-01-2010 12:19 PM - edited 03-01-2010 12:19 PM
03-01-2010 12:30 PM - edited 03-01-2010 12:31 PM
Actually the original problem description was more-or-less incomprehensible. She did a much better job of explaining it later in the thread, after several people went "huh?" But even then, there were typos in it...I noticed them too.
Of course, we were all stupid because we didn't understand her original description...
...and then we were all stupid because we suggested approaches she could try by herself, instead of posting already-written code.
My suggestion was the stupidest one, of course.
03-01-2010 01:08 PM
... of course... 😄
LOL!
03-01-2010 04:23 PM
DianeS wrote:
My suggestion was the stupidest one, of course.
Message Edited by DianeS on 03-01-2010 12:31 PM
Yeah but great for your post count! I make the thread to be about 5% of your great work 11/205
03-01-2010 06:03 PM
I hadn't even considered that!
And here's #12...let's up that percentage juuuust a hair more...
12-30-2011 09:50 AM - edited 12-30-2011 10:00 AM
Now that this thread has been idle for a bit I'll propose a solution on a track that wasn't offered. I just couldn't stand letting the year end without the simple solution being presented.
The only hard part was limiting the array size to 5 elements with 8.0 compatable functions (aren't lossy Queues and feedback nodes nice)
Virtual Kudos to all who tried to understand michelle's rantings.
(the title is a running inside joke)