LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

auto increment array index

Hi,

I have a small problem which i am trouble trying to figure out. Well i have 2 arrays with equal number of elements in each array. What i intend to do is to take the first element from each array and use them in a mathematical expression. Then i would like to increment the indexes of both arrays programmatically and then access the next elements from each array. This procedure is to continue till the end of the array(s). How can i do this. I have tried a couple of things but just dont seem to be able to get around the problem. Help!!!

 

I have attached the sample code below. I am using version LabVIEW version 8.5.1.

 

Thank you,

Arun

0 Kudos
Message 1 of 3
(5,656 Views)

Feed both arrays into a for loop.  Have the tunnels set for auto-indexing.  Do the math.  Have the tunnel going out the right hand side be set for autoindexing.

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
0 Kudos
Message 2 of 3
(5,649 Views)

In general, as Ravens Fan pointed out, use autoindexing in a loop to walk through an array. However, in your specific case you can simply use the polymorphic nature of the arithmetic functions. The functions adapt to whether you wire an array or a constant, or both.

 

Also with respect to your specific code, it seems to me that your input array should be an array of integers, not doubles. It appears that you are expecting an array of bytes and each two bytes represent a character. Is this unicode?

Message 3 of 3
(5,643 Views)