S5 Solutions | LabVIEW, ATE, Test Engineering Services
  • Engineering
    • Product Development
    • Custom Software Development
    • Automated Test Equipment (ATE) >
      • What is ATE?
  • Case Studies
  • Knowledge Base
    • ALOHA
    • MLA
    • LabVIEW & TestStand >
      • LabVIEW Basics
      • TestStand Basics
      • Learning LabVIEW
      • Getting Started with OOP
    • Blog
  • Contact

Ending Well

5/8/2020

2 Comments

 
A good rule to remember when designing a user interface is to do things in standard ways whenever possible.
​
For example, if you want to close a program in Windows, you click the X button in the upper right-hand corner of the window. 
Picture
Most LabVIEW apps have a tell-tale “Stop” or “Done” button. That always bugs me. Why shouldn’t a LabVIEW program end the same way any other Windows program ends?
​

They should. ​Here’s how to close your program the right way.
Picture
​In order to catch the press of the Close button, you need to use an event structure. The event structure allows you to tie into the Panel Close? event to make it run your code.

You will find the event under <This VI>Event Source. Take note of the question mark in the event name. There is also an event called Panel Close. You need the one with the question mark. It is a filter event. Since it is a filter event, it is indicated with a red arrow.

Filter events get called before the event is processed. By wiring a TRUE to the discard, the event is stopped, so the standard event handling is not processed. We have complete control over what we want to do in response to the event.

Now you have no excuse. So, please, no more “Stop” buttons.
CloseButtonToStopvi.vi
File Size: 13 kb
File Type: vi
Download File

2 Comments
Stuart Wilson
5/11/2020 10:19:29 am

What about reciprocally closing loops? For instance, the user event loop can send a message to other loops in the VI to close, but how do the other loops close the user event loop?

Reply
Craig Bedward
5/11/2020 01:37:07 pm

Other event cases can also set the stop flag to true; the close is not required to go through the Panel Close? case. The coordinated stopping of multiple loops can be challenging, especially when a number of loops are involved. That is one of the things that is handled automatically with our ALOHA and MLA system.

Reply



Leave a Reply.

    Categories

    All
    Events
    GUI
    LabVIEW
    Maker
    Project Success
    Special Interest

    RSS Feed

​Quick Links
Home
Services
Case Studies
ALOHA
​MLA
Privacy Policy
Picture
S5 Solutions, Inc.
LabVIEW & ATE, Test Systems, Software & Electrical Engineering Services located near Seattle, WA.


Contact Us
p: 425.298.7447
e: ​Info@S5Solutions.com
© 2023  S5 Solutions, Inc.           Employee Site
  • Engineering
    • Product Development
    • Custom Software Development
    • Automated Test Equipment (ATE) >
      • What is ATE?
  • Case Studies
  • Knowledge Base
    • ALOHA
    • MLA
    • LabVIEW & TestStand >
      • LabVIEW Basics
      • TestStand Basics
      • Learning LabVIEW
      • Getting Started with OOP
    • Blog
  • Contact