LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting Analog input 5v into TrueFalse ?

Solved!
Go to solution

So basically, how do i convert the 5v i get from my analog input DAQ into a true/false ?
True = " action " will be taken
False = nothing happen

any advice pls thx

0 Kudos
Message 1 of 8
(4,071 Views)

First you need to define an acceptable voltage range/threshold for your logic levels. The 5v sounds like TTL?? Low range is 0v-0.8V, and High range is 2v-5v, and it is undefined if the voltage is in between. Read your value from the DAQ and then compare it to your thresholds.

Message 2 of 8
(4,064 Views)

If you have a number and want to know if it is greater than another number, use the Greater? function from the comparision palette.  This returns a boolean which is True or False.  You can then wire that into a case selector on a case structure to do one thing or another.  You can also just wire the number to the selector if you don't mind working with integers and know that the value you want to compare won't change at run time.

Message 3 of 8
(4,049 Views)

Hey thanks for the advice , it's working already!
But i have a small problem , the readings from the input is jumping at different values so when i pass the voltage into my input , the readings from the DAQassistant will read all the readings and keep on approve the Greater than? even when  i pass the voltage for like 1 second only , what i want to achieve is to have only 1 reading(when i pass the voltage) at the DAQassistant in that 1 second , so it can only be True for one time when i pass the voltage; is it possible? 

sorry for my english 

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

@Roamingburger wrote:

Hey thanks for the advice , it's working already!
But i have a small problem , the readings from the input is jumping at different values so when i pass the voltage into my input , the readings from the DAQassistant will read all the readings and keep on approve the Greater than? even when  i pass the voltage for like 1 second only , what i want to achieve is to have only 1 reading(when i pass the voltage) at the DAQassistant in that 1 second , so it can only be True for one time when i pass the voltage; is it possible? 

sorry for my english 


Instead of telling us, in words, and apologizing for your (quite acceptable) English, attach your VI (there is a saying, "A Picture is Worth 1000 Words") so we can see exactly what you are doing, and can make helpful suggestions.

 

Bob Schor

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

I've attached my VI.

Take a look at the DAQassistant 5, i'm trying to change it in a way that once the voltage surpassess a certain value(e.g. 1v) , the action (in the case structure) will be taken ONCE,

and it will only reset when the voltage is below 1v

Meaning that when i press a button (5v is supplied) the action will be taken only once(when i'm holding that button) , i release the button(no action taken) and press it again then the action will be taken again.

1 press =  action taken once (even when holding)

 

right now when i'm holding the button it will keep on performing the action repeatedly 

0 Kudos
Message 6 of 8
(3,993 Views)
Solution
Accepted by topic author Roamingburger

Sounds like a place to use the Boolean Crossing PtByPt VI.  You can configure it to only give you a high value when the boolean input goes from false to true.


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 7 of 8
(3,964 Views)

Hey crossrulz thanks for that advice , i actually managed to solve my problem with that vi. Smiley Very Happy

0 Kudos
Message 8 of 8
(3,926 Views)