LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Releasing Notifier

I am using a notifier in one while loop to trigger sampling of data in another while loop, and it works fine.  My problem is how to release the notifier. 
 
If I try to release the notifier(with force destroy = T) in a thrid error loop I get this error :
Error 1 occurred at Cancel Notification in ReleaseResources.vi->MainTest.vi->StartUpTest.vi
Possible reason(s):
LabVIEW:  An input parameter is invalid
 
Two questions
 
1.I am using a local variable to pass the notifier to the Release VI .  Is this a problem?  I recall having similar problems releasing queues until I hardwired the queue reference.
 
2.I cannot use a timeout in the wait for notification VI as my application will sit idle between shifts.  Is release notifier the only way to kill the wait for notifier?
0 Kudos
Message 1 of 2
(3,509 Views)
 

Note - the error you're getting comes from the Cancel Notification primitive, not from the Release primitive. The reason for this is that once you destroy the notifier its reference no longer points to a valid object and so you get the invalid input error. This is actually something many people use to stop loops - you wire the error terminal into the stop condition and once the notifier\queue\whatever is destroyed the primitive will error and stop the loop.

Using a local to pass the reference is a possibility, but it is a potential for race conditions. If the local was read before the correct value was put into the indicator you would get the error you saw. Wiring is generally prefered in this cases (and in many other cases where you could use locals). In general - wires or synchronization objects should be used to pass data, not locals.

To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).


___________________
Try to take over the world!
Message 2 of 2
(3,494 Views)