LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Blinking LEDS with numeric control

Solved!
Go to solution

Hello,

 

I want to make a simple program that goes like this. I will have 2 numeric controls and 2 comparisons. 1st numeric will compare if the number if less than 50. Second comparison if it's greater that 50. If less than  50, the LED according to that number will blink up and stay on. If the second number is greater than 50 then the LED belonging to that number will blink and stay on. NOW...

 

If either OR both of these lights turn on, a THIRD light should BLINK off and on automatically. if both the first two lights stay off, then the third should stay off.

 

I tried to use shift registers and a delay to get the delaying but i'm stuck.

 

Any help would be great. Thank you !

 

Thuba25

0 Kudos
Message 1 of 8
(4,381 Views)
Solution
Accepted by topic author Thuba25

FIrst you need to change your code to a real interactive state machine. Your code is inside-out.

Currently the controls are read once at the start of the program and then never again.

 

  • Don't use inner loops. Use a single outer WHILE loop encompassing all code.
  • Get rid of the stacked sequence, it is pointless and just obscures the code.
  • The case structure belongs inside the loop and not vice versa.
  • Read the controls with every iteration and decide according to their value.
  • ...

See how far you get.... Good luck.

Message 2 of 8
(4,364 Views)

There is the property Blinking...


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 8
(4,363 Views)

Thank you for your help! I was wondering, how do you get the property node you were talking about ?

0 Kudos
Message 4 of 8
(4,354 Views)

@Thuba25 wrote:

Thank you for your help! I was wondering, how do you get the property node you were talking about ?


Right-click on your LED and select Create->Property Node->Blinkning.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 8
(4,352 Views)

I would actually blink it programmatically instead of with a property node. You have better control over rate and blink color.

 

Here's a quick draft. Modify as needed.

 

Download All
Message 6 of 8
(4,344 Views)

I'm having trouble with this VI. Would you mind posting the one you created? Thank you

0 Kudos
Message 7 of 8
(4,339 Views)

Which one is "this vi"?

 

Tim's VI is a snippet. Just download the image and drag it to the block diagram. It will turn into runnable code automagically. 😄

Message 8 of 8
(4,334 Views)