03-30-2010 09:46 AM
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)?
Solved! Go to Solution.
03-30-2010 12:15 PM
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