11-27-2008 05:46 AM
Hi nousome,
Take a look at your're diagram in debug mode(lamp)
dan you can see what's happening with your data.
may be this is what you're looking for.
Create a for loop over the complete diagram, except for the array with times.
disable the index and create another wire to the for from the array and enable the index. (see picture)
Fred
11-27-2008 08:24 AM
11-27-2008 08:24 AM
11-28-2008 01:55 PM
Untitled 1.vi (20 kb) |
12-02-2008 07:36 AM
Hi,
I worked a lot on this vi and I didn't success to make it work. I attached here my work. What I would like to do is to build an array as Raven's fan did that select randomly among an existing array without replacement (no more than one presentation per 5 trials). I would like more that 5 trials so at the 6th trial the new array could select among all the existing values of the 1st array. The problem that I encounter is I can't set more than 4 trials.
The other problem is that in the second sequence the function index value returns only one of the element and always this value because there is only one element in index. I don't know how to pick up each value in this architecture. Perhaps someone could fix this problem. I thank you in advance.
12-02-2008 09:17 AM
I'll start with the 2nd question first. You only get a single element because that is what you are indexing out of the array before the 2nd loop starts. The while loop keeps using that same element. Which element that is depends on the last value of that wire as it comes out of the loop. Either move the index array inside the loop and wire the iteration terminal of the loop to it. Or better yet, turn the while loop into a For Loop. Have the array go in as an autoindexing tunnel. Then you can eliminate the index array and also the code that counts how many times the loop has run.
For the first question, you will have to modify the code a bit. Once you have reached the count where the Used Array has filled up with all true, use a case structure to reset them all to False so that it is cleared for another round of choosing. The comparison could be And Array Elements. When that is true, you know its filled up. Then you could And the array with a single False Boolean in a case structure to clear all the elements.
12-03-2008 03:56 AM
12-03-2008 04:39 AM
Hi,
I worked on your solution and have still some troubles. I have well the array go in as an autoindexing tunnel but so I have problems to wire with my second loop to count time because it is an array. If I use index array I have still the same problem.
For the second solution I am not sure to understand how to do, I understand the reasonning but I am not sure to apply well the solution.You could see in the code attached here. Thank you very much for your help.
12-03-2008 08:29 AM - edited 12-03-2008 08:33 AM
My reply #26 was supposed to be the solution. But looking at it now, it looks like the wrong version of Untitled 1. I'll look around on my hard drive to see if I can find it again.
It looks like you replaced the wrong while loop with a For Loop. I said the 2nd loop.
Let me see if I can find my solution again and repost it. If not, I'll redo it.
EDIT:
I found it. When I back saved it to LV8.0 yesterday, it buried it and the subVI in weird subdirectories on my desktop.
12-03-2008 08:59 AM