LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I control enabling disabling of specific element of array using property node?

I have unsigned integer as control and this value can range from 0- N. I have an 1D array of combo box with N elements. Now according to the input given by the user i.e. in the control the elements in the array should get enabled or disabled.

 

Like for example if the user gave the value 5 in input than first five elements of the array should be enabled and rest all disabled how do I achieve this?

 

I tried using property nodes but it did not help!

 

0 Kudos
Message 1 of 11
(1,062 Views)

Hi Aliza,

 

simple rule: in an array all elements share the same properties!

You cannot disable/enable individual array elements...

 

You could hide the array index control and you could set the number of visible array elements instead. Or you can design a more user friendly UI...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 11
(1,054 Views)

You can't. All elements in an array have the same properties. You may simply use N separate combo boxes, showing the number of controls you need and hiding the others (make an array from their references to do this in a compact form). If you want to keep the controls bound together, you may group them in a cluster. In this case, the references array is the Controls[] property of the cluster.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 3 of 11
(1,051 Views)

Is the array of combo boxes itself a control or indicator?

 

You can hide the array index and scrollbar and set the container size to show the desired number of elements. Still pretty pointless because you need space for the max number of elements anyway.

 

Can you give some background what you are trying to do with all this? Maybe there is a better solution.

0 Kudos
Message 4 of 11
(969 Views)

You could trap the "Mouse Down?" event on the array, then optionally discard the event depending on the index.

Use the attached VI to get the index from the coordinates.

0 Kudos
Message 5 of 11
(953 Views)

Thank you everybody for helping! Really means a lot!

I got the solution when i pushed my brain a little that also without using property node and also not compromising on GUI. 

Download All
0 Kudos
Message 6 of 11
(936 Views)

Hi Aliza,

 


@Aliza24102002 wrote:

I got the solution


I don't think so…

  • Use autoindexing at the input tunnel.
  • Use ArraySubset when you want to process a limited number of array elements.
  • Adding zero is Rube-Goldberg!
  • Do you really need to overwrite the array control using a local variable?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 11
(931 Views)

The functionality that I needed is getting fulfilled.

0 Kudos
Message 8 of 11
(922 Views)

@Aliza24102002 wrote:

The functionality that I needed is getting fulfilled.


The fact that you don't care about the quality of your block diagram makes you a hack.

0 Kudos
Message 9 of 11
(906 Views)

ok I am sorry I got the point I will try to improve and keep that in mind

 

0 Kudos
Message 10 of 11
(902 Views)