Sunday, April 22, 2018

Led Toggling with Delay Using LabVIEW

In this post, I will show you guys how to use LabVIEW to toggle the LED with configurable on/off delay. In this post I am not using any hardware to turn on the LED, I am just using the internal Boolean LED indicator of LabVIEW, but if you want to turn of the actual LED, then that task is also very simple, you just have to trigger the command after the Led On and Off condition is satisfied, depending upon the hardware you are using (DAQ or Arduino or Custom).
Front Panel
The front panel is shown above, and the block diagram is shown below. To give variable delay in on and off state, a case structure is used, so there are two cases, one for on case and another for off case and they both are shown below.
On State

Off State
You can watch the following video to see all the steps used to construct this simple Virtual Instrument.

The following is the list of blocks used to construct this VI.
  • While Structure: this is used to run the program indefinitely.
  • Stop Button: this is used to exit the program.
  • True Constant: this is used to supply initial signal and then with the help of not block, this signal is toggled, which in turn toggle the led.
  • LED Indicator: this is a Boolean indication used as led.
  • Case Structure: this is used to handle the different delay timings during off and on state.
  • Off Time Control: this is used to provide the led off duration.
  • On Time Control: this is used to provide the led on duration.
  • delay: this is used to provide the delay in while structure.
Click Here to download the LabVIEW Virtual Instrument File.
In case of any questions and queries please leave a comment, I will try to help you.

No comments:

Post a Comment