I wrote this VI and I get an error 1 message at the release queue function when I run it. I don't know why the VI isn't working as it should. Could somebody run it and see if you could understand what the problem is. Please see the attached VI and typedef control.
Because the boolean terminals are not inside their respective event cases, they are not "read" by the program, except once right at the beginning of execution.
Move them inside and try again.
Another problem is that you pass a default queue reference to the Release Queue function. So it does not release the queue which is used in the Producer loop. Therefore, the Producer Loop never stops. The Exit case in particular is the culprit.
Solution: Do not use "Use Default if Unwired" on the exit tunnel from the case structure in the Consumer Loop. Wire through all cases.