LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to properly use notifier?

Hello,

 

attached is the screenshot of notifier communication. A NotifierSend.vi sends a boolean notifier (True), A receiver traps it in two loops.

 

I am getting the notifier indication properly in receive vi, but if I insert a "release notifier" after sending the notifier in NotifierSend.vi the receiver sometimes flashes error 1122, indication the notifier referance was destroyed when it was waiting. 

 

I just want to confirm if this is the right way of using notifiers. do we have to release the referance to notifier anytime?

I am going to use it to execute two  blocks in the receiver when ever the notifier is received.

Download All
0 Kudos
Message 1 of 9
(5,321 Views)

Hello,

 

Here is an example for using notifiers...

> Master loop : send notifications

> 2 slave loops : receive notifications ; each slave loop exits on error when notifier is destroyed (when you stop application)

 

J.

Message 2 of 9
(5,270 Views)

[...] do we have to release the referance to notifier anytime?

When you're all done with it; typically as the application gets shut down.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 3 of 9
(5,265 Views)

I just want to confirm if this is the right way of using notifiers.

 

I would really hesitate to confirm that is the right way.  I fact, I would say that that way shows that you missed something basic about using functions on the synchronization pallatte.

 

Go back through the shipping examples on queues and notifiers.

 

  • Do not use "Obtain Notifier" in a loop
  • Do not use weakly named notifiers.  In fact, use an unnamed notifier wherever possible to prevent some other chunk of code from doing unexpected things to "X" from some other place.  (Really!  Think about what would happen if you put together a large project and both you and a co-developer named a notifier "X"-  imagine the hair loss you would suffer trying to figure out what the heck happened when you got notifications meant for the other X or X got destroyed in the other producer?!!!!)

As an aside- You really should use the error chain to enforce dataflow rhater than those Flat Sequence Structures- Trust me you'll eventually thank me for telling you that.Smiley Wink


"Should be" isn't "Is" -Jay
Message 4 of 9
(5,239 Views)

Hi Julien,

 

 I am using version 8.6. Could not open your file. caould you post a version 8.6 vi or a screenshot? thanks a lot. I have moved the obtain notifier from inside the loop.

0 Kudos
Message 5 of 9
(5,211 Views)

Hi Jeff,

 

I have moved the obtain notifier from inside the loop. thanks.

 

the name was intended for labview forum. I do use more meaningful names in my code, like any other sensible programmer. 

 

 

0 Kudos
Message 6 of 9
(5,210 Views)

Also,

 

what exactly is 'ignore previous' in "wait on notification" vi?

0 Kudos
Message 7 of 9
(5,203 Views)

Also,

 

what exactly is 'ignore previous' in "wait on notification" vi?

0 Kudos
Message 8 of 9
(5,203 Views)

Here is the example for LV 8.6.

 

About "ignore previous" option, I strongly recommend having a quick look at function help. If I had to explain it, I could not do better than copying it... 😉 (unfortunately my LV is in french, so it will not help you ^^ )

 

0 Kudos
Message 9 of 9
(5,177 Views)