limit_warn()

Limits the value to default, mininimum or maximum value, issues a warning
Syntax
limit_warn(Parameter, MinValue, MaxValue, Default, Name)

Arguments
Name Description Range Type Default Required
Parameter Parameter to be limited (-∞, ∞) integer, real no
MinValue minimum value for the parameter [-LargestReal, LargestReal] † integer, real no
MaxValue maximum value for the parameter [-LargestReal, LargestReal] † integer, real LargestReal no
Default default value for the parameter (-∞, ∞) integer, real -LargestReal no
Name name of parameter string no
† LargestReal = 1.79769313486231e+308

Examples

Assume a circuit has a resistor R1. If you want to limit the value of the resistor to a minimum value of 10 ohms, a maximum value of 49 ohms, and a default value of 40 ohms, then set the parameter R of the resistor as:
R = limit_warn(Rval, 10, 49, 40, "R1 value")
where Rval is defined as:
Rval = 50
this displays a warning "While evaluating expression 'R1.R': 'R1 value limited to 49'"

Notes/Equations

This function is used to limit the value of a parameter to a default, minimum or maximum value. If the first parameter value is not set, then the value of the parameter is set to Default .
If MinValue is set, and if the value of the parameter is less than the MinValue, then the value is set to MinValue .
If MaxValue is set, and if the value of the parameter is greater than the MinValue, then the value is set to MaxValue .

 

Privacy Statement  | Terms of Use  | Legal | Contact Us  | © Agilent 2000-2008 

Contents
Additional Resources