From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Building a switch with a flashing pause indicator

Solved!
Go to solution

Hi I am new to LabView and coding so feel I am struggling with some of the basics. I am currently working through the Core 2 course online but am also having a go at writing my own applications.

 

I am trying to write an application based on the stopwatch example included in Core 1 however I would like the paused LED turned into a run indicator with the following attributes:

 

1, When the stopwatch is at 0.0 and stopped the LED to be off.

2, When the stopwatch is running the LED is solid on.

3, When the stopwatch is paused the LED flashes on and off.

 

Suffice to say I have implemented many iterations of the programme to achieve this goal but cannot get the timing to work reliably.

 

Any help would be appreciated.

0 Kudos
Message 1 of 7
(3,507 Views)

Suppose you had a While loop with nothing inside it (aside from a Stop button wired to the Stop Indicator) except for a Wait with 500 wired to it.  What would happen?  What if you had a Shift Register with a Boolean "True" wired (from the outside) to the input of this Shift Register, and inside wired to a Boolean LED Indicator?  What if you put a "Not" function on that Boolean wire inside the While loop?  What would you do to the Boolean wire to make the LED turn off and stay off?

 

Bob Schor

0 Kudos
Message 2 of 7
(3,467 Views)

Hi Bob,

 

Thank you for your suggestion. I understand that this is an accepted method to flash an indicator on and off at a pre-determined rate (2 Hz using your suggested value).  I already tried integrating this with the stopwtach code but the timing of this function corrupted the timing of the flashing LED, I just haven't yet grasped what is happening.

 

Regards

0 Kudos
Message 3 of 7
(3,381 Views)

Hz = cycles per second.  500 msec off + 500 msec on = 1000 ms cycle = 1 Hz.  Do you know about parallel loops?  A Flasher can run in parallel with a Timer (but you need to think about how to get "control" information, i.e. On, Off, Flash, into the Flasher).

 

Bob Schor

0 Kudos
Message 4 of 7
(3,360 Views)

Hi,

 

There are two common method to make an LED flash, firstly like Bob described using shift registers and secondly using the LED property node 'Blinking'.

 

I have summerised both methods in the attached VI.

 

Kind regards,

 

TomS

Applications Engineer

National Instruments

0 Kudos
Message 5 of 7
(3,323 Views)

Hi Tom_S,

 

Thank you for your reply, your post was very useful although I was aware of these particular functions in LabView already.

 

After further research I have managed to implement a VI which is able to toggle a single LED into three states: ON, OFF and flashing. I have included the code for interest and would gratefully receive any constructive feedback. My next task is to implement this SubVI into a stopwatch application.

 

Many thanks once again.

0 Kudos
Message 6 of 7
(3,272 Views)
Solution
Accepted by topic author HIRF

More better?  Only one loop, immediate response to shutdown, no Value property nodes...

 

RunIndicator (SubVI)_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 7 of 7
(3,259 Views)