|
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.
|