07-12-2016 03:49 AM
hello to everyone.
First of all thanks a lot for reading this post and helping me:
What I would like to do is the next.
I have a control and an upper limit and a lower limit.
If the control is between upper and lower limit, out has to be the same value than control.
If the control is higher than upper limit, then the out has to be the upper limit.
If the control is less than lower limit, then the out has to be the lower limit.
Is there any vi which do that?
I am trying to use "in range and coerce VI" but it does not wark how I want.
because for example is I put:
-upper limit = 512
-Lower limit = 36
-Control=300
Then the output is 36....
Any help??
thanks a lot
Solved! Go to Solution.
07-12-2016 04:22 AM - edited 07-12-2016 04:23 AM
-removed-- failed in my reading abilities
07-12-2016 04:25 AM
What?
07-12-2016 04:27 AM
it works for me ... don't know what you are doing wrong
07-12-2016 04:31 AM
as a suggestion for next time .. it helps very much if you post your code that troubles you, either as snippet or as vi
07-12-2016 04:32 AM
Hello,
The VI you mentioned works fine for me. Try tempering with its settings (right click).
If it doesn't work just implement the logic using embedded case structures.
Regards,
Adam
07-12-2016 07:07 AM
It should work fine for you!
Please specify the Version of LabVIEW you are using and also share the code which you are using.
07-12-2016 07:17 AM
@A.Salcedo wrote:If the control is higher than upper limit, then the out has to be the upper limit.
If the control is less than lower limit, then the out has to be the lower limit.
because for example is I put:
-upper limit = 512
-Lower limit = 36
-Control=300
Then the output is 36....
In this case, you're seeing an output of 36? If so, you've wired things up wrong and you should post what you've done so we can help. If you're saying you WANT the output of 36, that doesn't match what you said above. You likely have the upper and lower limits wired in backwards and that's causing the issue you're running into.
Additionally, you can right-click the control to find its properties. In the properties, you can set high and low limits and have the control coerce into that range so that the user will see the value being coerced. That way, if they type in 600 and the program uses 512 as the answer, they can SEE this taking place rather than have it happen on the block diagram where they're clueless to the change.
07-14-2016 02:42 AM
Thanks a lot to everyone for the information.
I have just solved with control properties.