LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change numeric control limits in an array of clusters

Solved!
Go to solution

Hi

I have an array of clusters that hold a parameter string, min and max values. This is Parameters Limits array in the vi posted below.

I have another array of clusters with a String, a Numeric control and a Boolean. I would like to dynamically set the limits (min, max) of this numeric control based on the values set in the "Parameters Limits". 

I am not sure that the clusters in the Parameter Array can have different limits... 

What I have tried, unsuccessfully, otherwise I would not ask this question here.

 

limits.png

Thanks a lot

 

 

Download All
0 Kudos
Message 1 of 9
(3,374 Views)
Solution
Accepted by topic author nitad54449

Hi nitad,

 


@nitad54449 wrote:

I am not sure that the clusters in the Parameter Array can have different limits... 


Simple rule: in an array ALL ELEMENTS share THE SAME PROPERTIES, they only DIFFER IN VALUE.

 

The data in your min/max inputs (inside each cluster) are values, the input limits are properties…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 9
(3,338 Views)

OK, got it. 

Thanks

 

PS: I think there is a way to circumvent this limitation, but it takes more time to program it and more ressources. I could follow the user entry values in an Event and accept the entered value only if it's in a specified range. 

0 Kudos
Message 3 of 9
(3,318 Views)

If the number of elements in the array is substantially fixed, you can replace it with a cluster of clusters.

In this latter case, you can change element properties at will.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 9
(3,301 Views)

Hi nitad,

 


@nitad54449 wrote:

I think there is a way to circumvent this limitation, but it takes more time to program it and more ressources.


Yes.

 

I usually DON'T show arrays on a GUI, but use (multicolumn) listboxes instead. When the user selects one item in the listbox I can present an option to edit just that item, either using a separate VI or using dedicated controls. As those controls are not part of an array I can edit their properties anytime as needed…

 

General suggestion: it often helps to differ between how data are stored/collected in memory and how they are presented to the user!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 9
(3,297 Views)

Yes, indeed. But for this case the number of elements depends on the user.

0 Kudos
Message 6 of 9
(3,290 Views)

First of all, you should get rid of that Rube Goldberg code:

 

altenbach_0-1729528131446.png

 

All you want is to enforce entry data limits, and that can easily be done with an event structure for the control where you look at the changed element, compare with the desired limits, and write back the oldval if the input is not acceptable. (Or coerce to the valid range, depending on the needs)

 

Simple skeleton (not fully validated):

 

altenbach_0-1729529908431.png

 

Of course you also need to decide what to do if the limits change later, etc.

 

0 Kudos
Message 7 of 9
(3,251 Views)

Hi Christian

It's a mock up vi to show what I was trying (and made several changes....)

it does not appear in my program 🙂

Regards

 

0 Kudos
Message 8 of 9
(3,242 Views)

Well, a mockup should typically simplify the presented scenario, not the other way around... 😄

0 Kudos
Message 9 of 9
(3,221 Views)