04-29-2010 04:22 PM
tbob, thanks for that explanation. It was very helpful. My only concern is if I create a program that has many non-queue events in the event structure. Then the terminated queue won't have the ability to shut down the producer. Since the program will still be running, a user may ignore the consumer error and keep making changes to the program. The program won't stop until a queue element is accessed. I also don't really like the idea of having to poll or access a queue in an event that really doesn't have a need for one (just to check for an error).
Oh, and could you please post the vi for version 8.5 or lower . Much appreciated!
04-29-2010 04:38 PM
I don't have 8.5 so I can't save it to that version. I have included a png to show what I did. I moved the error dialog from the Exit case to the Error case after the producer loop, and added a new error case after the consumer loop.
To notify the producer loop if an error has occured in the consumer loop, you would have to add a queue function to each and every event case. For cases when no queueing to the consumer is needed, you could use the Get Queue Status function or the Preview Queue function. Neither of these would upset the queue during normal operation, but they would allow for an error detection. Very little overhead and it gets the job done. Otherwise you would have to use some local variable to signal the producer to stop.
04-29-2010 05:47 PM