04-16-2008 07:51 AM
04-16-2008 08:00 AM - edited 04-16-2008 08:00 AM
I would guess that you're using a ring instead of en enum. There should be two little horizontal arrows on the inside-left of your constant
04-16-2008 08:09 AM
04-16-2008 08:40 AM
04-16-2008 09:25 AM
That statement makes absolutely no sense on various levels. The case labels are driven by what's connected to the selector terminal. What does "one case had no exit case defined" even mean?
@Holubtsi wrote:
I was actually using enumerated type, but it turned out one case had no exit case defined! Live and learn.
04-16-2008 09:39 AM
04-16-2008 09:56 AM
04-16-2008 10:00 AM
04-17-2008 11:10 AM
Holubtsi:
The state machine template that you are using is not quite the best. It looks for a "stop" enum to stop the loop. What if you wanted to do some clean up when stopping? Like turn off power supplies, etc. The best way to do it is to create an stop case when the "stop" enum comes up. Don't use the equal to "stop" function to stop the loop. In the stop case, wire a True constant to the edge of the case structure and then to the loop stop sign. The case edge terminal should be set to "Use default if unwired". When the stop case is called, you can put code to clean up and gracefully shutdown instruments, and then the loop is stopped. Also, from what I have seen from others (and myself), it is usually called "exit" or "quit" instead of stop. Just a personal preference.
04-18-2008 07:26 AM