LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Start, Stop

I'm battling through my fisrt program and have come to some roadblocks.  I'm trying to add a program start button, which sounds easy enough.  I'm also trying to add a program stop button, the one I have now only partially stops the program.  Also I have a timer that counts down but when the program ends I'd like that timer to read zero, currently it's not. 

 

Suggestions appreciated.

0 Kudos
Message 1 of 11
(3,628 Views)

Have a look at the example posted at this link.  It should get you started.  You may have to extract unnecessary code.

Unfortunately, I do not have LV installed on this PC so I cannot create an example for you or modify this one:

 

http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=386356#M386356

 

I will look for other examples


R

 

 

0 Kudos
Message 2 of 11
(3,622 Views)

There should be some examples in the example finder, such as "User Interface Event Example.vi." that Dennis mentionned in this post:

 

http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=16240#M16240

 

There are a couple of examples posted in the same thread.  They are older LV versions, but you should still be able to open the 6.x example.

0 Kudos
Message 3 of 11
(3,619 Views)

More exmples:

 

http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=389636#M389636

 

have a look at this example from JB:  http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=252128#M252128

 

 I can't remember what the attached example was for, but it might have the necessary start / stop features that you are looking for.  As I mentionned, I do not have LV installed, so I could not look at it.  The example should be aof an Event Structure that sends commands to a consumer loop.  It may have the start something and stop/exit features.  Hopefully it does.. 😉

 

 

0 Kudos
Message 4 of 11
(3,613 Views)

Thanks for that help. 

 

Not sure I used the most efficient method but for the most part things are working.  There are a few things I had questions on still. 

 

Is there a way to get the count down timer to read "0" after it's done counting down?  Other questions have to do with the stop.  The program doesn't stop during the inner count down it stops just after, is there a way to stop during the count down?  Also if stop is pressed the "program running" remains true even though the program has stopped.  Is there a way for these values and others values to return to zero after the program is interrupted by a stop?

0 Kudos
Message 5 of 11
(3,583 Views)

If no one beats me to the punch, I will have a look at your code tonight. 

🙂

0 Kudos
Message 6 of 11
(3,567 Views)

Can you convert your VI to LV8.5?

 

Thanks

 

R

0 Kudos
Message 7 of 11
(3,554 Views)
Here is that VI saved for 8.5 and cleaned up.
0 Kudos
Message 8 of 11
(3,551 Views)

Thanks Raven

 

Wow...  It is for the seeing impared..  🙂   It's great for my eyesight, especially being 1/2 blind..  LOL!  😄

0 Kudos
Message 9 of 11
(3,548 Views)

 

 The VI requires more cleanup and improved logic... and more cleanup.

 

I've modified the code to add an Event Structure that is only the beginning to the necessary cleanup.. 

It's late and my eyes can no longer see the screen. The next step is to remove the middle while loop (inside the state machine). It won't / should not be necessary.

 

Have fun.

 

R

0 Kudos
Message 10 of 11
(3,545 Views)