LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

New VI - default window size

Solved!
Go to solution

Is there a way to specify the default window size when the "new VI" action is invoked? Both for the block diagram and front panel?

 

In 99% of cases the front panel is way too large by default. I know I can just resize after, but it's becoming tedious to do.



Using LV2018 32 bit

Highly recommended open source screen capture software (useful for bug reports).

https://getsharex.com/
0 Kudos
Message 1 of 13
(5,804 Views)
Solution
Accepted by matt.baker

1. Use template.

2. Create a VI to dynamically call the template.  Save the VI as lv_new_vi.vi at:

C:\Program Files (x86)\National Instruments\LabVIEW 201x\resource\plugins\lv_new_vi.vi

 

lv_new_vi.vi will be called whenever you create a new VI.

 

George Zou
Message 2 of 13
(5,758 Views)

Thanks for the info George.

I've created a template (new_vi.vit) and a VI named lv_new_vi.vi and placed it under the directory mentioned, but it doesn't seem to invoke it when I use File-> New VI or Ctrl+N.

I've restarted LabVIEW as well.

 

Solved:

The lv_new_vi.vi must have an I32 indicator named "return value" wired to the top right connector.

0 for no error

1 for error

 

https://lavag.org/topic/11373-lv_new_vivi-conpane/

2017-07-24_17-10-38.png

VI attached (saved for 2009)



Using LV2018 32 bit

Highly recommended open source screen capture software (useful for bug reports).

https://getsharex.com/
Message 3 of 13
(5,740 Views)

For SubVIs where the front panel is never seen, I like to use this quickdrop shortcut:

https://forums.ni.com/t5/LabVIEW-APIs-Documents/Quick-Drop-Align-front-panel-controls-to-connector-p...

 

It aligns the front panel controls and indicators just like you have connected them on the connector pane. If you use it on the block diagram, it will resize the window to be just a little bit larger than your code, unless your code exceeds your screen size.

Message 4 of 13
(5,739 Views)

Fixed it

 

The lv_new_vi.vi must have an I32 indicator named "return value" wired to the top right connector.

0 for no error

1 for error

 

https://lavag.org/topic/11373-lv_new_vivi-conpane/

 

Thanks!



Using LV2018 32 bit

Highly recommended open source screen capture software (useful for bug reports).

https://getsharex.com/
Message 5 of 13
(5,729 Views)

That looks useful. I'll give that a try as well.

 

Thanks

 

Edit: Quick Drop takes a ridiculous amount of time to populate the list initially, so I'll have to give that a miss or assign it to a menu.



Using LV2018 32 bit

Highly recommended open source screen capture software (useful for bug reports).

https://getsharex.com/
0 Kudos
Message 6 of 13
(5,722 Views)

Hi Matt,

It should not take that long to populate quick drop, maybe 5 or 10 seconds... You can have it pre-load the palettes and quick drop on launch if you like, then you don't get that annoying "please wait while list is populating..." message. Go to tools >> options:

temp.PNG

Message 7 of 13
(5,694 Views)

I've just noticed that this doesn't work for New -> VI from the right-click menu on a project item

LabVIEW_2017-07-26_13-22-52.png

 

Is there any way to override this as well?



Using LV2018 32 bit

Highly recommended open source screen capture software (useful for bug reports).

https://getsharex.com/
0 Kudos
Message 8 of 13
(5,639 Views)

Thanks Greg

I have mine set to load when needed to keep the LabVIEW start-up reasonably fast.

What annoys me with the Quick Drop is that the loading/population is UI blocking (Windows even thinks LabVIEW has stopped responding) which is a really bad design.



Using LV2018 32 bit

Highly recommended open source screen capture software (useful for bug reports).

https://getsharex.com/
0 Kudos
Message 9 of 13
(5,634 Views)

Hi Matt

 

I think you can get around this by right clicking my computer and instead selecting New > New... > VI > From Template. Or you can put the vit file in the project, and then right-click it and select "New VI from template".

 

Best regards,

 

LeahE

0 Kudos
Message 10 of 13
(5,592 Views)