ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Limits on Variables

Hello, 

 

This is sort of a repeat post and I am pretty new to LabVIEW, but I am currently using a USB-231 to read voltage, current, pressure, and radiation from several sources. Each variable is increased incrementally. What I would like to do is write something that states if any of those variables goes above its limit, it forces that value back to what it was at before. I tried using in range and coerce inside a case structure but there seems to be a lot of flaws in doing that. I attached a jpeg of the portion of my VI that involves just the voltage variable. If anyone has any feedback or if I need to clarify something please let me know. 

 

Thank you!

0 Kudos
Message 1 of 2
(1,439 Views)

@tjhanks wrote:

Hello, 

 

This is sort of a repeat post and I am pretty new to LabVIEW, but I am currently using a USB-231 to read voltage, current, pressure, and radiation from several sources. Each variable is increased incrementally. What I would like to do is write something that states if any of those variables goes above its limit, it forces that value back to what it was at before. I tried using in range and coerce inside a case structure but there seems to be a lot of flaws in doing that. I attached a jpeg of the portion of my VI that involves just the voltage variable. If anyone has any feedback or if I need to clarify something please let me know. 

 

Thank you!


What kind of "flaws" are you talking about?  All the issues I know of simply stems from the lack of knowledge about floating point numbers and/or the fact that a programmer might not be aware that you can change the configuration of the terminals to make then end points inclusive or non-inclusive.

 

Normally the output of the In Range And Coerce is used as the input to a case structure, so I think it is best if you posted your code.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 2
(1,432 Views)