04-21-2010 03:42 PM
When you call a VI with an unwired input, the default value for the control is used. Most of the time, this makes good sense. But then how can you configure a VI to operate in a particular way, and subsequently call it to repeatedly perform some function given the prior configuration?
For example, suppose I have a VI that works something like a virtual o-scope. I want to configure the instrument once (set up all the controls: time base, volt ranges, etc) and then periodically take readings. Is there any way to do this without having to wire the setup every time I take a reading?
04-21-2010 05:20 PM
Use Action Engines or Functional Globals. They make use of un-initialized shift registers. Upon first call, the initilization must take place inside the vi. The init values get wired to the shift registers on the right side. Upon next call, the shift registers will retain the values that were set on the first call.
See the Action Engine Nugget created by Ben. Very useful and very practical.