LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using elements from the array sequentially?

Solved!
Go to solution

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.

Download All
0 Kudos
Message 1 of 4
(2,406 Views)

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

Message 2 of 4
(2,402 Views)
Solution
Accepted by topic author alams

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.)

Message 3 of 4
(2,401 Views)

THANK YOU very much. I have been able to resolve my problem with your suggestions.

 

Best,

Samia Alam

0 Kudos
Message 4 of 4
(2,385 Views)