LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the purpose of the Index Array Function in attached example?

Solved!
Go to solution

Hi,

 

I am struggling with the Index Array Function. I found the attached VI on the NI site which ws exactly what I wanted to do, but rather than just accept that it works and use it, I wanted to understand it.

What is the purpose of the Array Index Function inside the While loop? If I put a probe either side of it, the values are identical, yet if I remove the function and connect directly to the > function, I get errors.

I do understand arrays but I just don't get what is happening here. Any help would be gratefully appreciated.

 

Thanks in advance.

0 Kudos
Message 1 of 7
(3,048 Views)

First, don't put lv2009 in the name of your vi if its saved in lv2012, that's just annoying.  Having said that, and since I can't open the vi, I can only hazard a guess based on its name.  

 

Index Array extracts an element from your array for evaluation/processing/whatever.  The array isn't changed in any way... Think of it like copy/paste.   

0 Kudos
Message 2 of 7
(3,038 Views)
Solution
Accepted by topic author Mikea01

AI%20Threshold%20lv2009[1]_BD.png

 

It's just picking the first reading from the array in the waveform.  If this is good enough (I'd at least take the mean of the N Samples), why not this?

 

AI%20Threshold%20lv2009[1]_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 3 of 7
(3,032 Views)

Hi,

 

that was the filename on the NI site. I've renamed it now. I've also attached an image of the block diagram so that the VI doesn't need to be opened. So any help on what the Index Array Function is doing would be great thanks.

0 Kudos
Message 4 of 7
(3,031 Views)

Hi, thanks for your reply. We must have posted at the same time. I will look at your answer now thanks.

0 Kudos
Message 5 of 7
(3,029 Views)

Hi Jim,

 

I've looked at your reply and most importantly I understand it. Thanks for finding the time to answer this for me.

 

Mike

0 Kudos
Message 6 of 7
(3,020 Views)

[...] Thanks for finding the time to answer this for me.

You're welcome. You'll find no shortage of people here willing to help.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 7 of 7
(2,988 Views)