04-27-2010 04:05 PM
Hello:
In the following simple vi, how do I limit the value of x to always be greater than y?
For instance, if I set y = 10 then x cannot be set to a value less than 10. The values for x and y should remain changeable.
Thanks.
Solved! Go to Solution.
04-27-2010 04:07 PM
04-27-2010 04:17 PM
Thanks a bunch!
Now for a related question: I see that the function you suggested has a true/false output, perhaps I can use it for the following.
If I set x to be less than y (say x = 5 and y = 10) and I would like the value of x to not be allowed to be 5 but go straight to y if this is the case (o that x automatically sets to y when x<y), how would I accomplish this? Thanks.
04-27-2010 04:22 PM
AlfredoT wrote:
If I set x to be less than y (say x = 5 and y = 10) and I would like the value of x to not be allowed to be 5 but go straight to y if this is the case (o that x automatically sets to y when x<y), how would I accomplish this? Thanks.
That is exactly what the coerced output does. It will set the input (x) to either the high limit or the low limit (Y). In this case, x is lower than the low limit, so the coerced output will be equal to the lower limit. In whatever code you use X and Y as inputs, use the coerced output instead of X. No additional code needed.
My Labview is down, waiting for a license, so I cannot give you an example. I hope this is clear enough.
04-27-2010 04:27 PM
I understand what you mean because I have tested it. Thank you.
What I meant was something slightly different: I would like the value of x on the display to change from the value < y to y. I understand that the coerced output will be as such but the displayed x remains whatever value < y I had set it to.
04-27-2010 04:56 PM
Create a local variable for the X control (right click on control and select create - local variable). Wire the coerced outptut to the local variable. If you get a broken wire, right click on the local variable and select Change to Write.
04-27-2010 05:01 PM
Perfect!
Thank you. I wish I had thought of that.