LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Notofication, local variable which one is moe effective

Solved!
Go to solution

Hi, I want to pass one variable from Loop A to Loop B,  I am wonder which one is more effective, Notification or local variabe?

0 Kudos
Message 1 of 3
(2,251 Views)
Solution
Accepted by concorpoly

Well, they both are just as effective. If it is just a one way path from loop A to loop B you can just use a local variable but you could run into issues if you need all the data. If the writer loop writes the local then it has no way of knowing if the other loop has already read it so it will overwrite it. Also the receiving loop has no way of knowing if the data has been updated. If the receiving loop only needs the most recent value then you can get away with a local. But you have to continuously read from it whereas with a notifier you can just "wake up" the receiver loop when the value is written.

=====================
LabVIEW 2012


Message 2 of 3
(2,247 Views)

What ^ said.

 

A "notifier" acts like a queue of 1 element.  Same features as a queue, "dequeue element" and "wait on notification" both behave the same way when there's nothing in the pipeline. 

 

Local variables can be used, but you've really got to be careful where and when you write to them.  Generally safe with a "WORM" - Write Once, Read Many. 

 

For passing data between loops, I highly recommend a queue so you don't lose data, and you can adjust timing independently between the two loops. 

0 Kudos
Message 3 of 3
(2,240 Views)