From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error queue won't fill

Solved!
Go to solution

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?

 

 

0 Kudos
Message 1 of 6
(3,713 Views)

-I think if error in is connected to enqueue element and if there is error, it won't enqueue.

-try removing it and check.

Thanks
uday
0 Kudos
Message 2 of 6
(3,701 Views)
Solution
Accepted by topic author joptimus

@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.

0 Kudos
Message 3 of 6
(3,694 Views)

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.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 4 of 6
(3,685 Views)

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.

 

Thanks
uday
0 Kudos
Message 5 of 6
(3,682 Views)

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).


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 6 of 6
(3,679 Views)