LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read input then compare and turn on LED

Hi,

 

I have very little experience at writing in LabVIEW and am stuck on some basics. I was watching this video tutorial http://www.ni.com/white-paper/5370/en/ on building an analog input and all worked well. I was using a USB-6229 BNC and had a very slow varying voltage (0 to 5V) applied to Ai0.

 

I then wanted to to compare the varying input to a 2.5V level and then turn on a LED connected in series with a resistor to the digital output P0.0 if the input went above 2.5V and turn it off below 2.5V. It is this bit that I am stuck on. Can you help please? Once I've done a few of these exercises and find my way around, then I'll be on my way. It's just an initial bit of help needed. We've all got to start somewhere.

 

Thanks

0 Kudos
Message 1 of 5
(2,870 Views)

Hi Mike,

Can you attach your code or take a snap ?

so that we can have a good idea were you went wrong?

Boldness has genius, power and magic in it!'
0 Kudos
Message 2 of 5
(2,856 Views)

Hi,

 

I've attached an image of the block diagram. There isn't much added from the original NI example because I really didn't know where to begin.

 

Thanks

0 Kudos
Message 3 of 5
(2,851 Views)

Hi Mike,

 

don't read a waveform from DAQmxRead, instead set it to "1Chan 1Sample". Then you receive a scalar value to perform your comparison on!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(2,846 Views)

Hi GerdW,

 

thanks for your reply, but I dont really understand. As I said, my knowledge is very limited to non existent. I've got an analog input which feeds into a 'greater than or equal to' function along with a 2.5V set point. I just want to toggle a LED on p0.0 when the threshold is crossed. Any chance you could just show me this in the block diagram please? I will then undersatnd what to do and move on from there. It must be one of the simplest things to do if you know where to start.

 

Thanks

Mike

0 Kudos
Message 5 of 5
(2,835 Views)