10-20-2024 02:46 PM
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.
Thanks a lot
Solved! Go to Solution.
10-21-2024 01:34 AM
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…
10-21-2024 02:07 AM
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.
10-21-2024 03:13 AM
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.
10-21-2024 03:24 AM - edited 10-21-2024 03:26 AM
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!
10-21-2024 03:54 AM
Yes, indeed. But for this case the number of elements depends on the user.
10-21-2024 11:32 AM - edited 10-21-2024 11:59 AM
First of all, you should get rid of that Rube Goldberg code:
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):
Of course you also need to decide what to do if the limits change later, etc.
10-21-2024 12:50 PM
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
10-21-2024 04:07 PM
Well, a mockup should typically simplify the presented scenario, not the other way around... 😄