07-02-2009 04:23 PM
Hi,
I have created an array that includes four numbers/elements. i want to stimulate each element one after the other. afte creating my program, i observe that only the first element of the array is activated, but the others ar not.
I am actually using this program to stimulate four different odors. I have attached the whole program that controls the olfactometer as well as the part of that program that I am having problems with.
Do any of you have any idea how I can resolve the problem and can use all the different odors/elements during the experiment?
Sincerely,
Samia Alam.
Solved! Go to Solution.
07-02-2009 04:28 PM
You need to wire the index input of the Index Array VI. Or just wire your array from outside of the loop to the indicator inside the loop. This will enable automatic indexing (in contrast to yout attempt).
Regards
07-02-2009 04:29 PM
You have a dual case of "localitis" and "sequencetitus". Unneeded use of local variables and sequence structures.
Use wires instead of local variables where you can. If you wire your Stimulation type array through the wall of the For loop, you can set it up for Auto-Indexing. That means each loop iteration will use each element of the array in turn. Then you won't need the Index Array function, nor need to wire a 4 to the loop's N terminal.
(Alternatively, you could wire your loop's i iteration terminal to the Index terminal of the Index Array function.)
07-02-2009 05:17 PM
THANK YOU very much. I have been able to resolve my problem with your suggestions.
Best,
Samia Alam