05-17-2006 12:37 PM
05-18-2006 02:09 AM
Using PositiveInfinity and NegativeInfinity from the Programmer's Toolbox should do the trick:
SetCtrlAttribute (panelHandle, PANEL_NUMERIC, ATTR_MAX_VALUE, PositiveInfinity ());
SetCtrlAttribute (panelHandle, PANEL_NUMERIC, ATTR_MIN_VALUE, NegativeInfinity ());
05-18-2006 07:28 AM
Hi Roberto,
Thanks for the help. I ended up doing this by a more "brute force" kind of method - made a new numeric, placed it over the old one in the UIR panel, applied my limitations to the new one and left the old one at infinity max and min, then switched them using the visibility attribute depending on the selection in the ring control. I like your way better - less overhead involved.
Judy
05-18-2006 07:32 AM
PS for any NI folks who are listening, I looked high and low for a constant that would handle infinity. Something like VAL_NEG_INF or VAL_POS_INF. I did not expect to have to call a function to return the value. I'm guessing the same is true for something like PI - do I have to call a function to get that? I'm just kind of surprised these values are not constants within the CVI IDE.
Judy
05-18-2006 08:28 AM
05-18-2006 09:07 AM
Andy,
Thank you. I ran into the same problem - I'm using CVI 6.0 and no functions in the toolbox for infinity. I will use the ANSI C definitions instead.
Judy
05-18-2006 09:28 AM
Sigh! I tried the double max and min values and they are messing with the value of the numeric even though I am setting the attributes and not the value of the control. I am getting -2.somethin E-308 for the control value regardless of whether or not I set the value AFTER or before setting the control attributes. I'm going back to my brute force method for now, but thanks to both Andy and Roberto for their help.
Judy
05-18-2006 09:29 AM - edited 05-18-2006 09:29 AM
Judy and Andy,
Positive- and NegativeInfinity were added to 7.1 release of CVI so you can't find them in older distributions. However, Luis published the code for these functions in this post: you should be able to integrate in your code without problems.
Message Edited by Roberto Bozzolo on 05-18-2006 04:29 PM
05-18-2006 09:40 AM
05-18-2006 09:40 AM - edited 05-18-2006 09:40 AM
Message Edited by ajwalsh on 05-18-2006 09:45 AM