LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programmatically setting numeric control minimum/maximum but the behavior is not correct

I am having a minor issue with programmatically setting the maximum and minimum values for a numeric control.  I want to change the max/min depending on the value of the "band select" control.  I can't entirely figure out if I have done anything wrong.  When Band I is selected the min of both frequency controls should be 2.11E+9.  Max should be 2.17E+9.  For Band VII min/max should be 2.62E+9/2.69E+9.  Switching between bands should change the min/max values accordingly.  However, when I select Band VII the min/max is 2.17E+9/2.69E+9.  I have attached my VI in the hopes that if I've made an obvious error you'll be able to see it.  Thanks.  -Joel
0 Kudos
Message 1 of 7
(6,708 Views)
I think you have a condition where the order you set the min and max affects what the values can be.
 
You start with 2.11 and 2.17.  Then you set it to be 2.62 min and 2.69 max.  Well 2.62 min executes first, but that can't be the minimum because it is more than the max still defined as 2.17.  So it limits it to 2.17.  Then the 2.69 can be set to max without a problem.
 
Going the other way you do not have a problem.  You are at 2.17 and 2.69.  You set the min first to 2.11.  OK.  Then set the max to 2.17.  Still no problem.  If you happened to be writing to the max value first, then you probably would have a problem.
 
I would recommend that before setting the min and max with your final values, you temporarily set them to a much wider range such as 0 and 5.  Then when you write the new min and max values, they will both be withing the much wider range and they won't limit each other based on the previous min/max settings.
Message 2 of 7
(6,692 Views)
The attached code shown below works.
 
Set the maximum, set the minimum, set the maximum again.  This raises the maximum to allow the minimum to go up in the first case where the band is increased.  It also, resets the maximum in the second case where the band is getting decreased.  No need to set the min and max to some arbitrarily wider range.


Message Edited by Ravens Fan on 08-01-2008 11:44 PM
Download All
Message 3 of 7
(6,689 Views)
Better yet.  Write to the property node Data Entry Limits:All Elements.  Put a cluster in each case for Min, Max, and increment.  Since the cluster is written in one step, there is no conflict with the min and max crossing over each other.


Message Edited by Ravens Fan on 08-01-2008 11:57 PM
Message 4 of 7
(6,686 Views)
Hey thanks for the help.  The cluster solution is compact and works great.  I will probably use that from now on.

And I'm originally from Baltimore.  What are the chances?  Go Ravens as well!

-Joel
0 Kudos
Message 5 of 7
(6,642 Views)


Snood1 wrote:
Hey thanks for the help.  The cluster solution is compact and works great.  I will probably use that from now on.

And I'm originally from Baltimore.  What are the chances?  Go Ravens as well!

-Joel


You're welcome.Smiley Happy  What caused you to move from Balto.?  It's hard to believe the summer is almost over and football season is almost here.  Go Ravens!
Message 6 of 7
(6,630 Views)
Sorry wrong tread, though i Posted in the congratulations
 


Message Edited by BeCeGa on 08-04-2008 03:24 PM
Benjamin C
Principal Systems Engineer // CLA // CLED
0 Kudos
Message 7 of 7
(6,603 Views)