LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Property node for many items

Solved!
Go to solution

Hi,

I am working on a function that after entering the password, some items will change from "Disable and gray out" to "Enable".

image.png

The problem is, when there are many items, I'll have to create property nodes for each of them. As picture below.

It takes a lot of time and also make the block diagram a mess.

image.png

Is there any more efficient way to do this work? 

0 Kudos
Message 1 of 9
(4,269 Views)

How about using Control reference and using the Same on need basis for Enable and Disable in a Loop for same type?

 

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 2 of 9
(4,251 Views)
Solution
Accepted by topic author IanYuan

You can iterate over multiple controls or indicators via Front Panel->All Objects[] Property Node.

For example, somethijng like that:

Controls Disable.png

Message 3 of 9
(4,249 Views)

Hi Ian,

 

Is there any more efficient way to do this work? 

Well in nearly every programming language this rule is true:

When you want to repeat the same operation multiple times you should place that operation in a loop!

With LabVIEW you alos get autoindexing loop, that run very efficiently on array inputs…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 9
(4,248 Views)

Hi, 

I have tried Andrey's sample code and it's working great, thanks a lot!

But can I change the specific items in this way?

For example, if I'm going to change the setting for Boolean 1-3 but not Boolean 4-6, is it possible?

image.png

0 Kudos
Message 5 of 9
(4,228 Views)

Hi Ian,

 

sure!

First read the label of the fp element, then decide what to do based on the label…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 9
(4,222 Views)

Hi GerdW,

 

It's exactly what I'm looking for, really appreciate it!

Enclosed my code if anyone may need it in the future Smiley Happy

image.png

0 Kudos
Message 7 of 9
(4,205 Views)

Place them in a Cluster and disable/enable the cluster. 🙂

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 9
(4,191 Views)

Put the disabled control outside of the loop and wire in the value. Just nitpicking.

 

If your code only ever accesses the same controls, you can cache the control references on first execution to speed things up a little.

 

If you do things in a sub-VI, the caching can still be done if you choose "Re-entrant - preallocated clones". And here, if all the VI does is write to property nodes, you might also shave off some time by setting the execution thread of the sub-VI to "UI Thread".

0 Kudos
Message 9 of 9
(4,171 Views)