Daemon

From LabVIEW Wiki
Jump to: navigation, search

A daemon is a process that runs in the background, not usually visible to a user. In LabVIEW, daemons are usually implemented as one of two types: self-launched or launched.

Self-launching daemon

A self-launching daemon is a VI that executes, closes its own Front Panel, and continues to run in the background. A VI normally ceases to execute when its front panel is closed. To avoid this, a daemon VI first opens a VI reference to itself. The VI can then use the Front Panel:Open method to set the state of the VI to "hidden." In LabVIEW versions earlier than 8.0, the Front Panel:Open method is not available, but the Front Panel Window:Open property can be used.

Launched daemon

A launched daemon is a daemon VI that is opened by an intermediate, "launcher" VI. This allows a high-level VI to launch a background process and continue executing. In this case, the launcher VI opens a reference to the daemon VI and starts it using the Run VI method, with "Wait Until Done" set to False and "Auto Dispose Ref" set to True. The launcher VI must not close the VI reference to the daemon VI. Once the daemon VI has launched, the launcher VI can close itself.

External Links