LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why did I get error 1122?

I preapred a program to test something but I get error 1122 when I stopped the program. What is wrong with it?

 

error

Egemen
0 Kudos
Message 1 of 5
(5,531 Views)

There's nothing wrong, you just need to ignore the error. The error text describes what happened fairly clearly, I think. When you push the stop button, the top loop exits and destroys the queue. The bottom loop was waiting to dequeue from that queue, and suddenly the queue was destroyed. The way your code is written, you need that error to stop the bottom loop (and there's nothing wrong with that, I use this approach all the time). You may want to add some code that checks if error 1122 occurs, and if so clears the error, after you exit the bottom loop.

0 Kudos
Message 2 of 5
(5,494 Views)

How can I do that? I have never done something like that before? How can I detect the code and ignore it?

 

Edit: When I change the program as in the attachment, the error message does not pop-up. What is the difference? I do not understand.

 

 

Egemen
0 Kudos
Message 3 of 5
(5,484 Views)

@newbieeng wrote:

How can I do that? I have never done something like that before? How can I detect the code and ignore it? 


The easiest way is probably to use the the General Error Handler function in the Dialog & Error palette. It has an input that lets you ignore a list of error codes; see the help for details.


newbieeng wrote:

Edit: When I change the program as in the attachment, the error message does not pop-up. What is the difference? I do not understand.


Basic dataflow. The error occurs at the Dequeue function. With your change, the error output from Dequeue stops at the case structure. In your previous code, that error travels all the way to the Simple Error Handler, which is the function that pops up the dialog box. If that's not clear, try running your code with execution highlighting (the light bulb icon in the toolbar) and watch how the error travels along the wires when you push the stop button.

0 Kudos
Message 4 of 5
(5,451 Views)

Ok thanks. I handled with the problem. 😄

Egemen
0 Kudos
Message 5 of 5
(5,445 Views)