# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Help with "In Range and Coerce" Vi

I am trying to use, in range and coerce vi to determine if the measured time  was 10 ms within the range. The VI work fine except when the lower limit equal the measure time.  or when the measured time equal the upper limit.
How do you include the lower limit and upper limit ?

I am trying to use, in range and coerce vi to determine if the measured time  was 10 ms within the range. The VI work fine except when the lower limit equal the measure time.  or when the measured time equal the upper limit.
How do you include the lower limit and upper limit ?

Message 1 of 13
(4,787 Views)

## Re: Help with "In Range and Coerce" Vi

right clink on the node and select to include the lower/upper limit

Paul
Message 2 of 13
(4,785 Views)

## Re: Help with "In Range and Coerce" Vi

This is, of course, explained in the LabVIEW Help for that function. Did you read it?

Message 3 of 13
(4,772 Views)

## Re: Help with "In Range and Coerce" Vi

While Paul's suggestion above is a good one, you are probably not quite there yet.

Because of the inherent limits of the internal DBL representation, you might still get some unexpected results.

Where is the data coming from?

Message 4 of 13
(4,769 Views)

## Re: Help with "In Range and Coerce" Vi

@smercurio_fc wrote:

This is, of course, explained in the LabVIEW Help for that function. Did you read it?

read help?  who does that?

More to the point.  there are a lot of configuration items that are accessible through the right click context menus.

Paul
Message 5 of 13
(4,768 Views)

## Re: Help with "In Range and Coerce" Vi

@altenbach wrote:

While Paul's suggestion above is a good one, you are probably not quite there yet.

Because of the inherent limits of the internal DBL representation, you might still get some unexpected results.

Where is the data coming from?

To Altenback's point.  Typically when I use this function I will round the number up or down to the next increment of the precision I have the indicator.

For example.  Lower limit of 4.2, actual measurement 4.19998765.  This fails, but when looking at the results in an indicator, typically you would see 4.2 and not understand why it is failing.  So when the function returns a fail AND my indicator is set to show two decimal places, I will round the result down to 4.19 so it is obvious.  But when storing the date to file or a database, I write the full 4.19998765

Paul
Message 6 of 13
(4,761 Views)

## Re: Help with "In Range and Coerce" Vi

Apparently, he's dealing with "measured time", and I don't really know exactly what this means in this context (Measured how? ticks, timestamps, GPS, NTP, atomic clock, pendulum, etc...).

Personally, I would probably keep things as integer in milliseconds to remove all ambiguity. I love blue wires!

Message 7 of 13
(4,747 Views)

## Re: Help with "In Range and Coerce" Vi

thank for all the suggestions i already right click and including all the lower and upper levels. Can you please try the suggested values and tell me if it works on your pc.
Message 8 of 13
(4,727 Views)
Solution
Accepted by sticyfinger

## Re: Help with "In Range and Coerce" Vi

Same old story:

Make sure you display enough digits to see what is going on:

0.011000000000000001100000 lower limit

0.010999999999999999400000 value <---out of range!

(See attached examples)

Add a small increment to the limit (e.g. 0.0001) and you should be OK

Message 9 of 13
(4,717 Views)

## Re: Help with "In Range and Coerce" Vi

i am dealing with time in ms but i represent it with second. nothing complex.  i can  not afford to round the time up or down because time need to be accurate.

any other suggestion. ? maybe i can just minus .0001 from top level and buttom  level.

Message 10 of 13
(4,703 Views)