LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make the LED light blinking at a given freguency?

Hi. All,

 

I worte a labview program to turn on a LED light using the analoge out voltage in PCI-6030E daq card.

The driving voltage can be set to 3.5v to turn on the LED.

Please see my attached labview 8.6 program.

 

Now, I hope to make (or modulate) the LED blinking (switch on and off) in likely 100Hz or even faster.

 

How should I modify my labview program?

 

Thanks very much.

 

Rogers

 

0 Kudos
Message 1 of 6
(6,964 Views)

Put a shift register on the loop border.  Wire in a 0 to intialize.  In the loop, put in a delay for however many mS you want the LED to toggle on and off.  Put in a case statment.  If shift register value is below 1 (don't use equal on a floating point number), then change the output to 3.5.  If not below 1, then change the output to 0.  Wire the output of the case to the shift register on the right side and to the data in of the DAQ assistant.

I don't have LV8.5 so I can't code your vi.  But here is a snippet showing the code:

 

AO.png

 

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 6
(6,958 Views)
Thanks for the suggestion. I will check it and let you know the results. Cheers~
0 Kudos
Message 3 of 6
(6,919 Views)
You could also create a square wave and pass that to the DAQ Assistant.
0 Kudos
Message 4 of 6
(6,912 Views)

Dennis Knutson wrote:
You could also create a square wave and pass that to the DAQ Assistant.

I also tried this, however since any current between 3 and 3.5 volt can turn on the led in a different brightness. When the square wave changing the state, the LED didn't really turn off.

Since the LED provide a lumination for my camera. I do see some brightness changing in square wave modulating. I need the LED on/off change sharply.

Thanks.

0 Kudos
Message 5 of 6
(6,902 Views)

Dennis's method should work.  How did you generate the square wave?  You should be able to set the high voltage and the low voltage individually depending on how you generated the square wave.  Use the Analog function for generating a square wave, not the digital function.  With Analog, you can specify the voltage level exactly.

 

Example_VI.png

- tbob

Inventor of the WORM Global
0 Kudos
Message 6 of 6
(6,892 Views)