LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a True/False output from analog input

How do I create a single bit True/False output from a analog input?

 

The application has two analog inputs. One typical voltage from a joystick contol and the other is old-school opamp logic of +/-15V used for motor control. How can I process the array to get a serial bit stream of the T/F data of the opamp signal (VEAC), so that when the input is above a preset value the output is true and otherwise the output is false.

The AI inputs are duplicated to simplfy testing.

Hardware it cDQQ-9134

Labview 2015

Screan capture and vi attached.

Download All
0 Kudos
Message 1 of 10
(5,523 Views)

If you have an array of booleans, you can use

  • "and array elements" to get a single boolean that is true only if all elements are true
  • "or array elements" to get a single boolean that is true if at least one element is true.
0 Kudos
Message 2 of 10
(5,519 Views)

I need the output to process the data such that it's true when the input is above 5 votls and False if it's less than that.

This signal is a contol input indicating when the brake is applied and data can be moved from the queue to a TDMS file.

sc

0 Kudos
Message 3 of 10
(5,513 Views)

@scott312 wrote:

I need the output to process the data such that it's true when the input is above 5 votls and False if it's less than that.

This signal is a contol input indicating when the brake is applied and data can be moved from the queue to a TDMS file.

sc


You're gonna be really angry when 4.99 V turns out to be FALSE.

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 4 of 10
(5,485 Views)

It appears the convert from dynamic array will sort of do what is needed. See the attached screen capture. The Boolean output reflects the T/F state of the last element of the array. If the waveform graph was static and never changed becasue the frequency matches the graph 1hz then the output Boolean will not chabge. Real world application is greater than 1 sec so this will work as I believe the last element of the array represents a 10ms delay and not 100x10ms.

If there is a way to process the array separately bit by bit that would be ideal. Any suggestions appreciated.

sc

0 Kudos
Message 5 of 10
(5,435 Views)

You are converting an entire waveform down to just a single scalar data point.

 

What you are doing in the lower part is correct using the Get Waveform Components.

 

If you want to process the array bit by bit, then feed that array of booleans into an auto-indexing tunnel of a For Loop.

 

If you want to have the results faster, then capture fewer samples in your waveform and they'll be smaller arrays that you can than process more often.

0 Kudos
Message 6 of 10
(5,429 Views)

Thanks for the help. The indexed For Loop did as indicated. In terms of pseduo real-time the waveform to scalar boolean seemed to provide a quicker response time. The data is queued so I should be okay.

sc

0 Kudos
Message 7 of 10
(5,411 Views)

It only seems quicker because you are throwing away all of your data points you collected except one.

0 Kudos
Message 8 of 10
(5,389 Views)

I've needed much hand-holding through out the development effort. Your help is very much appreciated.

sc

0 Kudos
Message 9 of 10
(5,373 Views)

You're welcome.

0 Kudos
Message 10 of 10
(5,366 Views)