LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sequence of blinking leds

Well here is the problem I am having, I would like to create a labview project that has a series of 8 leds that blink in sequence (similar to the knightrider light bar). I can get 1 led to blink in an array of leds and then by changing my input I can get all the other leds to blink but I cannot seem to figure out how to increment the array so that each element in the array blinks 10000000 then 01000000 then 00100000 then 00010000 and so forth, I am extremly new to labView and am trying to teach myself. I am familiar with C and LabView seems extremely confusing and frustrating to me. Any help/sample vi's etc. would be appreciated.

Dan Ziehm
0 Kudos
Message 1 of 21
(9,058 Views)
Dan,

Welcome to LabVIEW.

When converting from a text-based language to LabVIEW, the key concept is that LV is based on a data flow paradigm while languages like C are control flow languages. This means that in LV any node (function, VI, etc.) cna execute whenever all the wires leading to it have valid data. The order of appearance of the items on the blocka diagram has nothing to dowith the execution order.

The tutorials are very useful for newcomers.

Now, to your blinking LEDs. One way to do this is to make an array of your LEDs. Create a while loop with a shift register. Initialize the loop with the 10000000 array. On each iteration of the loop replace the subset of the array containing 10 with a 01. Put a delay (Wait(milliseconds) function) inside the loop to control your blink rate. Add a Stop button to exit the loop when you are done with the blinking.

This will be a nice little exercise that helps you learn many of the basic elelments of LV.

Lynn
0 Kudos
Message 2 of 21
(9,046 Views)
Thank you, I appreciate the advice. I will attempt your suggestion and post my results if successful 🙂 If not you will hear from me shortly.

Thanks again,

Dan
0 Kudos
Message 3 of 21
(9,045 Views)
Here is one way to do it.
- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 21
(9,039 Views)
No need to do any fancy math. Just initialize a TFFFFFFF boolean array then rotate it in a loop by the remainder of the loop count divided by 8. (See attached example).

If this is just for cosmetics, you could also just make an 8-frame animated GIF and place it on the front panel. No code needed at all. 😉
0 Kudos
Message 5 of 21
(9,027 Views)
Altenbach: I like to use the fancy math. 😉 At least I get to use some of what I learned in college. 😄 😄 😄
- tbob

Inventor of the WORM Global
0 Kudos
Message 6 of 21
(9,021 Views)
here is yet another method to give you the Knight rider grill
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 7 of 21
(9,001 Views)
Thank you everyone!! these samples are really showing me how I can do what it is I needed to do, I was discussing the issue with our in house "traditional" programmer and we came to the conclusion that an if then statement imbedded in a while loop of some sort (if x
Keep up the good work,

Dan
0 Kudos
Message 8 of 21
(8,993 Views)
Thank you everyone!! these samples are really showing me how I can do what it is I needed to do, I was discussing the issue with our in house "traditional" programmer and we came to the conclusion that an if then statement imbedded in a while loop of some sort (if x less than y with y equal to 16 increment x then when x equals y start decrementing until x equals 0 repeat). I have come to the conclusion that the case statements are the closest equivalent to accomplishing traditional if/then's, I was formulating my solution when I recieved the reply from LV_pro, AWESOME!!!! That was exactly what I was looking for and to my surprise along the lines I was following myself. Thanks again I am really learning here!

Keep up the good work,

Dan
0 Kudos
Message 9 of 21
(8,988 Views)
sorry about the semi double post but the board doesn't like equal and if, less than signs, my text dissappeared, must have seen it as pseudo html or something 🙂

Dan
0 Kudos
Message 10 of 21
(8,984 Views)