LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ring Control/Indicator Min/Max Values

Is there a simple way to retrieve the minimum and maximum values of a Ring control or indicator?

 

I'm not looking for "Data Entry Limits", so that hasn't been useful.  The only thing I've been able to do is use the "Strings And Values []" array, however even THAT is problematic, as it returns an array of clusters.  To use "Array Max & Min", I have to use a for loop to index the array, and create a new array of just the Values.

 

Is there either a way to just get the Min & Max, or an easier way to get an array of the values?  Ring controls have both a "Strings []" and  "Strings and Values []" property, why don't they have just a "Values []" property?  Perhaps there's a way to UN-Index and UN-Bundle a Cluster Array?

 

I'm using LabVIEW 8.5.

0 Kudos
Message 1 of 6
(2,931 Views)

Hi Ron,

 

If you keep the "Sequential Values" checkbox checked then you should be able to just use the "Number of Items" property, knowing that min has to be 0 and max has to be number of items minus one (as long as their is atleast one item).

Message 2 of 6
(2,924 Views)

Thanks for the quick reply.

 

That's a great tip, but what if I don't have or want Sequential Values?  I suppose I should have used more complicated data in my example VI, but in my actual application, we populate our Ring controls at runtime, and depending on the situation, the minimum value may be something other than zero.

0 Kudos
Message 3 of 6
(2,920 Views)
I dont see a better way to do this than the method you posted.  Is there a reason you dont want to use a for loop to unbundle the value from the array of clusters?
0 Kudos
Message 4 of 6
(2,915 Views)

I'm always looking for a better way to do things, and thought perhaps I was missing something.

 

If there was a way to get the a "Values []" array directly, obviously I would prefer it.  I also wasn't sure if there was a better way to unbundle a cluster array -- a reverse of "Index and Bundle Cluster Array" would certainly be quite handy.  It would make the block diagram a bit cleaner.

0 Kudos
Message 5 of 6
(2,911 Views)
I agree with you that a reverse of "index and bundle cluster array" could come in handy.  I am pretty sure that the way you are solving this problem is the best.  The only other way to solve it I can think of is to convert the array of clusters to a variant data type and then flatten this to a string and parse the string for the data.  This way is a  lot more cumbersome and does not get around having to use a loop.  Maybe someone else can think of a better way, I am interested to hear if there is.
0 Kudos
Message 6 of 6
(2,900 Views)