From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Why It Is Important To Know How To Abort VI Execution

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview
This VI programmatically resizes and moves itself randomly every 1/2 second.  It is designed to teach a user about using the keyboard to abort a VI's execution (which can be done usint <ctrl+.>


Description
This VI uses random number generators inside of a while loop to programmatically move and resize the acquisition window.  Because the abort button is disabled, the only way to stop the VI is to use the keyboard abort or manage to press the stop button located on the front panel.  After 50 unsuccessful seconds of stopping the VI, a hint appears for how to stop it.

 
Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Open " Why Programmatic Abort Is Handy 2012 NIVerified.vi"
  2. Run the program

 

Additional Information or References
VI Block Diagram

 5-103.png

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
sara111
Member
Member
on

<ctrl+.> is not very useful in case the labview window has lost focus. In this case it is quite deficult to stop  vi like that.