LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Guide on when to use Globals, Notifiers or One-Element Channel Writers ?

I'm sort of confused on WHEN each of these three is employed BEST?

Currently i'm heavily relying on Notifiers to shuffle data around - but im just doing it cause im used to.

 

Is there a concise guide around where each technique fits best (In terms of Performance and Best Practice)?

 

I'm specifically refering to 

  1. Global Variables
  2. Notifiers
  3. One-Element Stream Channel Writers

as i use these more or less the same but have no idea where there optimum field of application is.

Message 1 of 4
(2,907 Views)

Not really.  But I'll put in my 2c.

 

1. Global Variables are very fast, but work best if there are less than 2 writers.  0 writers would be a fancy constant that can be used in multiple places.

2. Notifiers are typically used as a lossy message protocol to many locations.  You will have to worry about timeouts and other timing situations (time will be different if a message is received).

3. Streaming Channel, as far as I am aware, is meant for a 1-to-1 communication.  If you are comparing to a Glabal Variable, the closer equivalent would be the Tag Channel.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 4
(2,855 Views)

@Philipp_Elhaus wrote:

I'm sort of confused on WHEN each of these three is employed BEST?

Currently i'm heavily relying on Notifiers to shuffle data around - but im just doing it cause im used to.

 

Is there a concise guide around where each technique fits best (In terms of Performance and Best Practice)?

 

I'm specifically refering to 

  1. Global Variables
  2. Notifiers
  3. One-Element Stream Channel Writers

as i use these more or less the same but have no idea where there optimum field of application is.


I believe that answering that question is important. 

 

Could you show some examples? The use case is a factor in determining which method is "Best" and, there IS no current guideline document. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 4
(2,842 Views)

@Philipp_Elhaus wrote:

I'm specifically refering to 

  1. Global Variables
  2. Notifiers
  3. One-Element Stream Channel Writers

You are mixing Apples and Oranges.  Global Variables and Notifiers are both Many-to-Many methods of Asynchronous Communication (you can have Many "writers" putting data in, and many "readers" taking data out).  The Channel Wire that best corresponds to the Notifier is not the One-Element Stream (a One-to-One method), but the Tag Channel.  I think of it as a "Notifier, Evolved".

 

I would say that which one you use depends (a lot) on the specifics of the task and the nature of the communication, including the nature of the communication network (one-to-one, one-to-many, many-to-one, many-to-many), whether communcation is within a VI or between VIs, "need for speed", "need for clarity", and personal preferences.

 

Myself, I prefer Tag Channels for many-to-many (though I've also used Messenger Channels in this situation).

 

Bob Schor

0 Kudos
Message 4 of 4
(2,797 Views)