LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using comparator and DAQ to turn on an LED

Solved!
Go to solution

I am using a comparator in Labview to compare sine wave to a fixed voltage then displaying the result (1 or 0) on a waveform graph. How could I use the comparator result to output to a DAQ to turn on an LED(eg. when the result is 1)?

 

 

0 Kudos
Message 1 of 2
(2,916 Views)
Solution
Accepted by topic author PinkLady4128

In LabVIEW, click on <Find Examples>...<Hardware Input and Output>...<DAQmx>...<Digital Generation>...<Write Digital Chan.vi>.  The block diagram for that VI will show you a Boolean array as input.  In order to use a single Boolean value instead, specify a single line in the "create task" VI (for instance, Dev1\port0\line0) and then connect your LED to that line.  Then, in the code, select the "single channel / single sample / Boolean (1 line) instance of DAQmx Write.  Then wire the output of your comparator to the Boolean input of DAQmx Write.

 

If you modify the VI, save it with a different name in a different location.  Do NOT overwrite the example VI.

 

Hope that helps!

d

Message 2 of 2
(2,903 Views)