LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reference to array element


Intaris wrote:

This "Index Vals" approach ONLY works RELIABLY if there is only one array element visibly on the Array control / Indicator.

 

Otherwise clicking on any array element besides the first one before running the VI will return false values.

 

Shane.


It will for the most part return the value in the top left position of the control. That is why Andrey second example does not work (there is only one refence and it only point to the top left item).

 

Re: the Strict type

 

You can try making it non strict but you are still coding up a cluge to adhear to C concepts. Its time to "go with the DATA flow."

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 11 of 15
(2,728 Views)

@Andrey_Dmitriev wrote:
 

Hi, Will,

Not fully understand what you need, but you can get reference to array element by according property node:

but you will be not able to get array of refences of the elemenths, because you have only one.

For example: this code looks the same but will not work:

Andrey.

 



Hi.., As it is a constant, its okay.. But, when it is a Control, if the active index (the array element that v have clicked with mouse cursor or edited at last) is not the 0th Index, then I couldn't get the Reference of all the array elements in order., I am missing few elements due to the above problem. I am using the method which you have describes., so pls guide me how to overcome this issue..

 

Thanks in Advance..!!

0 Kudos
Message 12 of 15
(2,180 Views)

@Ben wrote:

Re: the Strict type

 

You can try making it non strict but you are still coding up a cluge to adhear to C concepts. Its time to "go with the DATA flow."

 

Ben



I agree wth Ben. It sounds like you are trying to do things like you would if you were using C. LabVIEW is a data flwo language and it would be in your best interest (and everyone that touchs the code after you) that you learn how to use data flow correctly. Otherwise you are basically trying to fit round pegs into square holes.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 13 of 15
(2,170 Views)

Hi Guys,

 

This is my first post/question on the forum, so please forgive any obvious bone headed questions.

 

I'm not happy that I can't use the blinking attribute on an individual element in an array of booleans... and maybe I'm not the only one. So I've been monkeying around trying to get a color box blinker arrangement that could be used instead... this suggested by others.

 

I've got an actor set up to blink a CB. It's working the way I want and can control the Fgd, Bgd and blink rate, etc. Among other things, I pass this actor a ref (that it uses to access the CB it's blinking).

 

My problem right now is that I need to pass the actor a ref to a single CB that's in an array. I found posts that show how to get a pointer to an array element (seems like excessive work, but hey).

 

Da5idF_0-1603061630990.png

 

Question:

What is the symbol (I've tried to find it!) that is converting the loop variable to the input to IndexVals?

 

Thanks in advance for your help.

 

-Dave

0 Kudos
Message 14 of 15
(109 Views)

The function between the i for the loop and Index Values is "Build Array".

 

But your VI still not going to do what you want it to do.  "Index values" sets which element is shown in the upper right hand corer.

0 Kudos
Message 15 of 15
(104 Views)