LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Access directly to Cluster on Front Panel inside other control

Solved!
Go to solution

Hi All,

 

I want to update and access directly to the Value of Cluster on the Front Panel of my VI using Reference, and Ctrl Set Value.

But my Cluster (CONTROL 1) is inside and other cluster and inside Control Tab , so "Ctrl set" function can't find the name of my Cluster .

How can i proceed ? I'm not familiar with Reference Control .

 

I have attached an extract of my VI .

0 Kudos
Message 1 of 12
(7,521 Views)

try to use a property node directly for the control/indicator

change-value-w-prop-node.png


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 2 of 12
(7,485 Views)

Try this,

 

You can modularise it a lot more than this.

Essentially you need to drill down through the structure to find the control you want.

You could create your own front panel search for control VI function and use the "Set control values by index" function to do it too.

 

(depending on how many controls, you might try getting control values by index and seeing if you can use that to scan the FP with a variant conversion?)

 

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 3 of 12
(7,481 Views)

@jwscs wrote:

try to use a property node directly for the control/indicator

change-value-w-prop-node.png


Well there is also the easy way too is you don't want to run headerless and have something that might be re-usable!

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 4 of 12
(7,479 Views)

I can't find a clean solution, but this works:

gncv.png

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 5 of 12
(7,468 Views)

Do you have the LV 2010 version of your file ?

0 Kudos
Message 6 of 12
(7,454 Views)

so there we have it!

 

The clean solution. - but very specific.

The generic solution - but you need to know your specific tree.

The midway solution - but it uses VI scripting, and therefore might not work in the runtime environment. (I think that is why I use the approach I do, but it could just be habit.)

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 7 of 12
(7,453 Views)
Solution
Accepted by topic author rock_31

Saved back to 8.6 in case anyone wants to see earliertest_ctrl2.png

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 8 of 12
(7,447 Views)

Thx all for your help, 

 

It's seems like i don't have other choice than do a loop and compare one by one each control with the control i want to find ?

Humm....This is what I would like to avoid....I have about 150 controls (Clusters) in my front Panel; so may be, it could take some time to do that ....

0 Kudos
Message 9 of 12
(7,429 Views)

store the reference to the control in a global or something, after you've found it.

then subsequent changes don't need you to loop through all stuff.


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 10 of 12
(7,421 Views)

Depends on how you have them arranged.

You can tree down quickly using my method.

Bear in mind that each page of a tab control has a different reference to it.

I bet not all 150 clusters are on the same tab page or just on the FP directly. - and I don't expect you need to update them all the same.

 

Are you trying to update all instances of the same cluster type - if so you might be better to do create initialisation function which gets all the references and allows you to update at runtime a specific one inside an action engine.

You want to think about which bits you want to make parallel, which things you want to make scalable and how fast your code wants to run.

Lots of open references = higher memory, but faster access is you know which is which and you don't need to keep searching for the control.

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 11 of 12
(1,472 Views)

This old nugget of mine shows how to get at the values of FP objects.

 

No scripting required, works in exes and can be a starting point to develop code to get at arbitrary FP controls.

 

It would be hard to get any more obfuscated than that code.

 

But it works, and does not rely on any new fangled gizmos.

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 12 of 12
(1,453 Views)