08-03-2016 07:01 AM
Hi,
I finally implemented my error handling only to get a new problem: My error queue stays empty.
What should happen is the following:
1. One or both of my instruments report an emergency stop. Since that doesn't constitue an error, I generate one (code 9999)
2. If an error occurs, it is added to the front of the (initially empty) error queue.
But when I query the status of the queue after the error occured, it is empty (see attached image). I executed the VI piece by piece with highlights and the error is definitely generated and goes into the "enqueue element" block.
Is there something I missed?
Solved! Go to Solution.
08-03-2016 07:10 AM
-I think if error in is connected to enqueue element and if there is error, it won't enqueue.
-try removing it and check.
08-03-2016 07:17 AM
@udka wrote:-I think if error in is connected to enqueue element and if there is error, it won't enqueue.
-try removing it and check.
That did it! Never would have guessed...
But if I remove the error in, then my error output stays empty. Is the error not "duplicated" by being enqueued?
Ideally, I would like to have the error reported to other VIs via the queue and within the VI where it occured in the error out cluster.
08-03-2016 07:27 AM
You need to merge the errors after the enqueue. Most VIs have 'standard error functionality' which means that if there is an error in, the VI won't execute and will pass the error in to the error out. Some VIs will execute even if there is an error (e.g. 'close' VIs). If you want the enqueue to occur, but for the error to be passed through, merge the errors after the enqueue.
08-03-2016 07:34 AM
I think the number of elements in error queue shows that errors are enqueued isn't it?
-If you dequeue the same queue you can get the error cluster what data you enqueued.
-The error out after a vi gives error if any error occured in previous vi, since no error occured in getting no of elements in queue you will see no error.
-If you want to pass that error simply connect through the case structure and pass to shift register.
08-03-2016 07:42 AM - edited 08-03-2016 07:45 AM
Oh yes - you also need to be very careful about wiring your errors into a shift register - if an error occurs, it'll get passed to the beginning of the loop and none of the VIs will execute because of the standard error functionality - you will need to clear the error somewhere (or don't make it a shift register).