LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to do autoindexing in labview 8.2

hello friends,Smiley Indifferent

 

as i found when an array connected to a for loop it is by default set to auto indexing,,and i can get the element of the array one by one,

but in labview 8.2 its not by default,,

can you pls let me khnow how to auto indexing an array in labview 8.2 to get the array element one by one??

 

 

Message Edited by tinamoli on 10-09-2008 02:49 AM
0 Kudos
Message 1 of 6
(3,123 Views)

Hi tinamoli,

I worked with 8.2 and didn't have that effect. It worked like in the releases before (and in 8.5.1, which I'm using currently).

You have to wire an array from the outside of the for- loop, else it won't switch to autoindexing input. And on the other hand, there is the possibility to switch the loop- input terminal to autoindexing via context menu.

Greets, Dave

Message Edited by daveTW on 10-09-2008 09:58 AM
Greets, Dave
0 Kudos
Message 2 of 6
(3,119 Views)

If you right click on the input or output tunnel on a for loop or while loop it will bring up a little menu. On this menu you can select either enable autoindexing or disable autoindexing.

 

I hope this is of help.

 

best regards

Graham Green
Software Product Marketing
NI | Emerson
0 Kudos
Message 3 of 6
(3,115 Views)

Smiley Very Happy

 

hopefully i could do auto indexing,thanks a lot

 

but i did autoindexing to take each elements of an array one by one,for example:

i want to have the first element then subtract it from second,third,....and so on.

 

but by auto indexing enter all element at once,

please tell me how to have each element separately??

 

thanks ,

0 Kudos
Message 4 of 6
(3,077 Views)

Not sure exactly what you are trying when you say subtract first from second value, etc., but here is a way to do it with autoindexing and a shift register. The case statement is to make sure that there is data in the register (the first element) before the subtraction is performed. The second time through the loop the first val is subtracted from the second, the third time through it will be the result of that

subtraction subtracted from the third element, etc.

 

 

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 5 of 6
(3,069 Views)

Hi there,

 

not really sure I understand the problem you are having.

 

For me when I wire an array to a for loop, I can select whether the autoIndexing is on or off. (As mentioned in the post above.) 

 

With autoindexing enabled, everytime the for loop goes round another interation of the loop, one element of the array is pulled off and can be manipulated as desired.

If autoindexing is disabled, then the array is passed into the for loop as a whole. (I.e. you get all elements at once.)

 

If you would like to subtract each item in the array from the last, keeping a running total, you can use a shift register, initialised to zero before entering the loop. 

 

paul.

 

 

0 Kudos
Message 6 of 6
(3,068 Views)