10-01-2015 03:28 PM
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.
10-01-2015 03:31 PM - edited 10-01-2015 03:32 PM
If you have an array of booleans, you can use
10-01-2015 03:38 PM
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
10-01-2015 07:22 PM - edited 10-01-2015 07:22 PM
@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.
10-02-2015 08:31 AM
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
10-02-2015 08:41 AM - edited 10-02-2015 08:44 AM
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.
10-02-2015 10:00 AM
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
10-02-2015 12:29 PM
It only seems quicker because you are throwing away all of your data points you collected except one.
10-02-2015 04:03 PM
I've needed much hand-holding through out the development effort. Your help is very much appreciated.
sc
10-02-2015 04:27 PM
You're welcome.