07-14-2009 12:08 PM
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.
07-14-2009 12:18 PM
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
07-14-2009 12:21 PM
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.
07-14-2009 12:29 PM
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.. 😉
07-15-2009 08:34 AM
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?
07-15-2009 12:13 PM
If no one beats me to the punch, I will have a look at your code tonight.
🙂
07-15-2009 08:47 PM
Can you convert your VI to LV8.5?
Thanks
R
07-15-2009 09:15 PM
07-15-2009 09:32 PM
Thanks Raven
Wow... It is for the seeing impared.. 🙂 It's great for my eyesight, especially being 1/2 blind.. LOL! 😄
07-15-2009 09:51 PM
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