08-20-2010 10:16 PM
i want to do a VI that does the function of 3 astable timers but i want that the program doesn't close when the timers end
08-23-2010 10:17 AM
Great. What have you tried so far? Have you looked at shipping examples? Have you done the LabVIEW tutorials?
You could, for example, make a producer-consumer VI. Your producer would have an event structure that adds a state to a queue and your consumer is a state machine. Simple, effective.
08-23-2010 01:10 PM
Wow, there are so many ways to achieve that. There is the producer consumer scheme as one solution. Another solution would be to create a sub-vi out of the timer portion and then put that in a switch in a loop... see example.
Good Luck!
08-23-2010 01:16 PM
Comments regarding the code provided by Drewski:
08-23-2010 01:27 PM
Wow, you looked at my code, cool. Thank you for the feedback.
You're right, latch on release would eliminate the property nodes. My covert reason for using them was to introduce the programmer to alternatives to local variables.
You're also right about the "stop" being superfulous, as the loop would stop. I'm not clear on how it is BAD. Can you please educate me on that? My covert reason for explicitly using the stop was so that a "Quit" could be installed in it's place later for application type behavior.
Thanks and Good Luck.
08-23-2010 01:55 PM
@Drewski wrote:
Wow, you looked at my code, cool. Thank you for the feedback.
You're right, latch on release would eliminate the property nodes. My covert reason for using them was to introduce the programmer to alternatives to local variables.
That's perfectly fine, as long as you also provide the caveats for local variables: http://forums.ni.com/t5/BreakPoint/Why-some-people-say-Local-Variables-are-bad/td-p/711239.
You're also right about the "stop" being superfulous, as the loop would stop. I'm not clear on how it is BAD. Can you please educate me on that? My covert reason for explicitly using the stop was so that a "Quit" could be installed in it's place later for application type behavior.
The Stop function performs the same exact action as clicking on the Abort button in the toolbar. It will certainly stop your program, but there are consequences, such as (potentially) references not being closed, files left open, etc. As the signature of a regular says, a tree will also stop your car, but there are consequences.