Example Code

Programmatically Open and Close VI in Specified Position.

Code and Documents

Attachment

Download All

Overview
This VI allows the user to specify another VI to open/close and set the position in which the Front Panel will open.


Description

This is particularly useful when used in conjunction with a VI type that does not allow the user to set a "Window Run-Time Position", such as a Global Variable container VI. This VI makes use of a state machine structure to ensure that the specified VI location only changes when the VI is first opened, allowing the user to reposition the window afterward.


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Open Set Window Bounds.vi
  2. Specify a file path to the VI you wish to open programmatically.
  3. Specify the window bounds for the VI that you are going to open.  These are in units of pixels.
  4. Use the open/close specified VI front panel control to open/close the specified VI in set location.

 

Additional Information or References
VI Block Diagram

Block Diagram.png

 

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

 

Tom L.

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