LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error on notifiers when stopping software program

Hi,

 

I am getting two errors when i attempt to close my program which are related to the notifiers used in the 'live data' tab.

 

The first error tells me that the refnum to the notifier has become invalid while it was waiting, and the next one tells me that there is an error in the notification sent to it.

 

I have attached my program, and screen captures of the errors. The errors relate to the middle while loop.

 

The procedure that I am using is pressing the start test button to start the test and again to stop the test, and then going to the home screen and pressing 'end application' to quit the program. Each of these stop the while loops in the program.

 

A little bit of help to understand how to close these notifiers would be great.

 

Thanks in advance

Rhys

Download All
0 Kudos
Message 1 of 6
(2,331 Views)

The issue is with the local variables. You are pressing stop and one loop will possibly exit first which destroys the notifier. Then, the notifier no longer exists when trying to read the notification in the parallel loop. You have no defined shutdown sequence so it's hard to tell you how to fix this. You really need to rearchitect your code with a queued state machine (or something of the like) in order to easily troubleshoot these kind of problems. It's almost impossible to follow data flow with nested loops and local variables.

0 Kudos
Message 2 of 6
(2,324 Views)

Personally I would ignore both errors, and turn off automatic error handling in the VI properties so you don't get the error dialog box. The errors are telling you that in one case you attempted to do something with the notifier (cancel notification) after you already released the notifier, and in the other case, that you released the notifier while you were waiting on it in another loop.  These are probably not serious errors if they only occur when you exit the program, although you might want to pay more attention to the order in which you are doing notifier operations.  There's no point in trying to cancel a notification if you've already destroyed the notifier.

 

I can't really understand what's going on in your VI.  Why do you have so many nested while loops?  What's the purpose of the outer while loop, which, so far as I can tell, will only execute once?

0 Kudos
Message 3 of 6
(2,323 Views)

@nathand wrote:

...and turn off automatic error handling in the VI properties so you don't get the error dialog box. 


The only issue have with this is that I have been burned when an error cluster accidentally wasn't wired up and I didn't realize an error was happening because automatic handling was turned off. Then when I found there was an error happening somewhere, but had no indication of where, I had to dig through the code trying to find it. Anyways, that's just my two cents about why I leave the automatic error handling on. If I need to ignore an error, I just use the general error handler VI with the thought that the error will be ignored, but someone that picks up my code understands that I mean to clear that specific error in that specific spot.

0 Kudos
Message 4 of 6
(2,320 Views)

Thanks for your thoughts on my problem.

 

What would be the most suitable way to quit an application when using the master/slave design patter and the use of notifiers. What is the most efficiet way of stopping multiple loop when using this type of program structure.

 

This is my first application in labview so it is a major learning curve for me, thankyou for you patience.

 

Rhys

0 Kudos
Message 5 of 6
(2,305 Views)

In situations where I have one loop generating notifications and another waiting on them, I often use the error from the waiting loop to stop that loop when the program exits.  The loop that generates the notifications releases the notifier when it exits, and this in turn causes an error in the waiting loop.

0 Kudos
Message 6 of 6
(2,303 Views)