LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set Default Window Open Size

I want LabVIEW to open VIs windows so that they are never larger than my computer monitor screen.  Some VIs open and I have to resize the window before I can see the entire window.  How do I make LabVIEW both open VIs, front panels and block diagrams so they are never outside the monitor edges.

0 Kudos
Message 1 of 6
(385 Views)

Pretty sure there's no way to make LabVIEW do that.

 

Sorry, don't shoot the messenger.

 

LabVIEW will put a window on a screen if the coordinates are off-screen (e.g. made on a 2nd monitor that isn't available), but that's it.

0 Kudos
Message 2 of 6
(352 Views)

Hi tfilipiak,

 


@tfilipiak wrote:

How do I make LabVIEW both open VIs, front panels and block diagrams so they are never outside the monitor edges.


Workaround: press Ctrl-T after opening the VI! (This will place the frontpanel and blockdiagram next to each other, with each occupying half of the screen…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 6
(336 Views)

I haven't tried, but it probably should be possible:

 

  1. Search online for the supersecret INI key, so you can access private methods.
  2. Create <vi.lib>\lv_init.vi. This VI is called when LV is launched and can be used to run your own VI in the background (it should run in the NI.LV.AutoLaunch context).
  3. To actually launch your process VI, use the Application class method OpenVIAsSystemVI to get a reference to the VI and you can then call the Run VI method with wait until done= F. I believe this is needed so that LV doesn't consider the VI as open when you close all of the other VIs, but I haven't tested all of the permutations.
  4. For your actual process VI, you will want to look at either the Application>>VI Activation or Application>>Window Opened event and then use the reference for the FP window or BD window to check if it's in the bounds of your monitor and if not, move it.

 

A couple of notes:

  1. This uses some private and unsupported features. It's not guaranteed to work and can cause all kinds of issues.
  2. I haven't tested any of this. This is speculation and you will need to test. It's easier to test your process directly before having LV launch it.
  3. This all assumes that you're talking about edit-time stuff (since you talk about BD windows). For run-time stuff, you can set window positions and sizes in the VI properties and programmatically.

___________________
Try to take over the world!
0 Kudos
Message 4 of 6
(326 Views)

@tst wrote:

A couple of notes:

1) Search online for the supersecret INI key, so you can access private methods.

 

3) This all assumes that you're talking about edit-time stuff (since you talk about BD windows). For run-time stuff, you can set window positions and sizes in the VI properties and programmatically.


Or on an application method, do DQ, "OpenVIAsSystemVI", then CTRL+SHIFT+B

 

Or drop this after downloading it (properly):

Open VIAsSystemVI.png

0 Kudos
Message 5 of 6
(308 Views)

@tst wrote:

Create <vi.lib>\lv_init.vi. This VI is called when LV is launched and can be used to run your own VI in the background (it should run in the NI.LV.AutoLaunch context).


Clarification: I'm not sure if the VI runs in the AutoLaunch context on its own. You might need to get all the contexts, iterate over them until you get to the right one and then use that context as the application reference for the method in the next step in order to launch it there.


___________________
Try to take over the world!
0 Kudos
Message 6 of 6
(288 Views)