Download Untitled
Transcript
Instance Close? events normally cause the VI or LabVIEW to shut down immediately, these events must be discarded for the shutdown routine to run. This is achieved by wiring a TRUE Boolean constant to the Discard? filter event terminal. Figure 8-6C. Three separate events that trigger a shutdown include the Application Instance Close?, Panel Close?, and Quit Value Change. The former two events are discarded to allow the shutdown routine to run. [View full size image] In Figure 8-7, the Torque Hysteresis VI has been implemented as an event-handling loop based on the template. The front panel is identical to Figure 8-5A and is not shown. Each of the controls from the Boolean menu have a corresponding Value Change event case that executes the same code contained in the Case structures in Figure 8-5B. The Event-Handling Loop is more compact, flexible, and efficient than the Continuous Loop implementation. A single Event structure with multiple event cases is more compact than the multiple Case structures. Also, it is easy to add more event cases or divide the existing event cases into multiple event cases without increasing the height and width of the diagram. Moreover, it is more efficient than the Continuous Loop because the diagram sleeps until a registered event fires, freeing the processor to work on other tasks. Figure 8-7. The Torque Hysteresis VI is implemented as an event-handling loop. This is a more compact, flexible, and efficient alternative to the Continuous Loop implementation in Figure 8-5. [View full size image] 253