View Single Post
  #2   Spotlight this post!  
Unread 08-03-2011, 15:46
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: How To use Global variables and sequences

It is all about using the right tool for the right job. Are you sure you want a global? Would a queue, a notifier or a user event work better for your application?

User events notifiers and queues can be passed around to subVIs, which makes code re-use easier later.

A queue allows you to guarantee that you will get all the data across, but is typically one write/one read.

A notifier only pushes data when you are ready to read it - if the listener is busy, it (intenionally) drops the write on the floor.

A user event is one write/multi read, but harder to use.

A global is easy to use, but doesn't have some of the extra features of the other options.



Also, always lump related data together - if you use something as a cluster, make it a cluster. This will ensure that the entire kit'n'kaboodle gets written simultaneously, and will prevent you from reading half new and half old data.
Reply With Quote