LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW In Range and Coerce Function

Hi everyone, I am using the LabVIEW "In Range and Coerce Function" specifically for coercion sake.  I am only using the "Coerced(x)" output and I am NOT using the "In Range?" output.

 

I am feeding a number in and if it is less that 0 I was to coerce that number to 0 and feed it out the "Coerced(x)" output.  I set the lower limit of the function to be "0" and did not wire the upper limit.  When I do this my VI has a broken arrow and the way I was able to fix the broken arrow was to wire a constant to the upper limit input of the function.  Why do I need to wire the upper limit if I am only using the lower limit for coercion?  Is there another way around this?  I just don't want to put a fake number in the upper limit just to satisfy the borken arrow issue.

 

Thanks!

0 Kudos
Message 1 of 8
(5,063 Views)

The In Range needs a RANGE to test to.  Therefore, you need an upper and lower limit.  Just use +INF (if using double floating points) for your upper limit.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 8
(5,048 Views)

Simply use the Max&Min comparison function to return max(0,x).

Message 3 of 8
(5,040 Views)

Hi,

I'm not an expert of any sort but it sounds like you might be better off using a "less than" node connected to a case structure. If it the number you are feeding the node is less than x then the case is "true" and you can have constant "0" feeding your indicator outside of the case structure. If the number you are feeding the node is NOT less than x then the case is false and you can just connect your input that you want to show in your indicator. 

 

As an intermediate level user myself, I have to say using the HELP menu (ctrl+h) is a huge help. You'll notice if you put your mouse over the "In Range and Coerce Function" that all the inputs are in bold letters. Bold letters means that you WILL have a broken arrow unless something is connected. 

 

Hope this helps!

 

After I posted this I saw the other replies and as usual there's an easier way than my method 🙂 but this can still be useful for other applications

Message 4 of 8
(5,035 Views)

What does it means. please tell

"The function performs the coercion only" 

 

 

0 Kudos
Message 5 of 8
(4,086 Views)

@Chishti wrote:

What does it means. please tell

"The function performs the coercion only"  


Since this sentence was not mention in the old thread above, I guess you are talking about the help page. The full sentence is "The function performs the coercion only in Compare Elements mode.". Still unclear?

0 Kudos
Message 6 of 8
(4,083 Views)

yes. In my opinion, if the value of 'x' is in the range of upper and lower limit it will return the value of 'x'. If not, then it will return the output value. Is it so?

 

0 Kudos
Message 7 of 8
(4,080 Views)

@Chishti wrote:

yes. In my opinion, if the value of 'x' is in the range of upper and lower limit it will return the value of 'x'. If not, then it will return the output value. Is it so?


 

Your sentence makes no sense. It will always return an output value.

 

Did you understand my comment about the comparison mode?

0 Kudos
Message 8 of 8
(4,077 Views)