Example Code

Programmatically Set a Sub Panel to Open in the Same Position in LabVIEW

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 example show how to programmatically set the origin point of subVI to a specific place in a Sub Panel

 

Description

This example show how to programmatically reset the origin of a called subVI, so that it loads in the same place in a Subpane every timeregardless of the window size and position when the subVI was saved. Note, the main Front panel window will default to being the "zeroth" Pane in the panes[] array (at the index array), but you can manually rearrange the panes, but by default this will work. 

In this VI we reset the origin of the subVI to 0,0 so it will load in the origin at the top left corner of the sub panel. When you place controls and indicators on your subVI plan for the origin to be in the top left corner.

 

Requirements

LabVIEW Full Development System 2012 or compatible

 

Steps to Implement or Execute Code

  1. Enter the SubVI path to be loaded in the Sub Panel
  2. Enter the desired Origin Position in the control
  3. Run the VI

  

Additional Information or References

  Before and after running the VI

SubPaneOrigin Before and After.png

 

VI Block Diagram

 4136.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
Todd S.
NI Employee (retired)
on

well done sir!

Todd S.
LabVIEW Community Manager
National Instruments
joshuatree
Member
Member
on

can u post an earlier version Please...  8.0 would allow a greater majority to open it.

nvm

setsubpanel.jpg

EricEvola
Member
Member
on

I had this exact issue and this post saved me some sweet time.

Thank you for the contribution. Nice work.