LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

flashing led

Hey, i'm new to Labview and i have a problem to do... i'm finding a little problem in creating a flashing led :

  • If you have chosen “flashing” from the switch, then the LED should light up for a time equal to the value of the “ON TIME” control and then the LED should turn off for a time equal to the value of the “OFF TIME” control.

any help will be very much appreciated 🙂
regards,
karamdeek

0 Kudos
Message 1 of 10
(4,949 Views)

Did you do it like this or is it more complicated?

Tim
GHSP
0 Kudos
Message 2 of 10
(4,938 Views)

Sounds like homework so I'm hesitant to provide a complete solution.  Post whatever attempt you've made so far and we'll help you out.

 

Hint: A shift register holding a boolean in a while loop is a good place to start.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 3 of 10
(4,930 Views)

it's a small part of a big problem.... not the whole HW, the only part that is causing me trouble 😛

 

well my problem is with how to input the time for the on and off phase of the led. should it be using a flat sequence inside a while loop and using a wait block?

0 Kudos
Message 4 of 10
(4,918 Views)

ty, sorry but i couldnt open it since i'm using the version 8.2

0 Kudos
Message 5 of 10
(4,914 Views)

If you need to controll the timing then things get more complicated. You will probably need to have the blink feature in a seperate loop and and send an evet that tells it to blink. THen you can set up timing in that loop to handel the different blink time and have the program turn on an off the light.

Tim
GHSP
0 Kudos
Message 6 of 10
(4,909 Views)

Here is 8.0 version

Tim
GHSP
0 Kudos
Message 7 of 10
(4,905 Views)

is it possible to do it using a flat sequence containg the wait time ?

0 Kudos
Message 8 of 10
(4,876 Views)

Why would you ever want to use a Flat Sequence? You don't need one.  You should avoid using Flat Sequences.  Especially Stacked Sequences.

 

If you want to swap the While Loop to a Flat Sequence, no you cannot use a Flat Sequence.

 

0 Kudos
Message 9 of 10
(4,865 Views)

 


@Karamdeek wrote:

is it possible to do it using a flat sequence containg the wait time ?


Flat sequences are frowned upon as there's almost always a better way to solve sequencing problems with proper program flow.

 

 

I think this part of your problem is to help you learn about shift registers and structures within structures.  These basic skill are required when you want to control a logical flow of events.

I'm probably giving away too much here but look at the pic and try to figure out what is in the other cases that make this VI work.  Once you do, break it down into small steps or draw a flow chart and see how the labview structures mimic the decisions you have to make to cause the LED to flash as your requirements specify.

 

Good Luck!

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 10 of 10
(4,851 Views)