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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save Parent window

Hi,

 

          I had question regarding parent and child window. If i create many child windows in a single parent window, is it possible to save the parent windows and load the same again? I don't need the values of particular control or a indicator in a child window, which is done using config file. So, how to do it? any examples please do post.

0 Kudos
Message 1 of 11
(3,462 Views)

Sorry I am not able to understand your question about Parent and Child window concept, can you please explain that with an image may be? Are you calling the Main and the sub VI windows as Parent and child? Also what do you mean by Saving the Parent window?

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 11
(3,452 Views)

I believe he is talking about user32.dll calls to make a parent child window relationship.  Something like an MDI.

 

This might be what you want for loading a position relative to a parent..

 

https://decibel.ni.com/content/docs/DOC-20462

 

Also you can still use the normal windows dll calls on a window that is a child.

 

http://www.ni.com/example/29935/en/

 

In there, there is a VI that can move a window based on a HWND.

0 Kudos
Message 3 of 11
(3,433 Views)
Hi,
I have already created parent and child window. The problem in the application is that, I want to create more parent windows and also save parent windows and load. The loaded parent window should have controls or indicator child windows when saved. So, how to go on with that part?
0 Kudos
Message 4 of 11
(3,429 Views)

What do you want to save and load?  The parent control values?  The parent position?  The child position? The child control values?  The children parent relationship?

 

All can be done you just need to code it.  On exit perform the save of whatever it is you want.  Then on load go through a routine that loads those settings from a file.  The OpenG Variant Configuration palette has Write Panel to INI and Load Panel from INI which makes loading and saving control values quite easy.

0 Kudos
Message 5 of 11
(3,426 Views)

Hi,

 

        To be more clear i have attached a pic of front panel of the current project. In the pic you can see there are many child window (sub vi's) on single parent window (main.vi). The problem, If i save and current parent window and load the same window later,  the indicators or child windows should be present with default values. So, how to do it in this manner? any examples?

0 Kudos
Message 6 of 11
(3,392 Views)

Well, first the proper way to do child windows in a main windo is really to use sub panels. They are the LabVIEW native way of embedding VI front panels in other VI front panels and work across all LabVIEW platforms the same. Using Windows API calls, if you do that, is cumbersome, likely to cause all kinds of troubles if you do not know EXACTLY what you are doing and a maintenance nightmare as you will keep running into strange effects with new Windows versions sooner or later.

 

That said, whatever you do, LabVIEW subpanels or Windows parent-child windows, they are setup at runtime and you as the programmer are the sole responsible person to load them at the right time in the right plkace and with the right content. If you want to have an ability to rebuild a particular constallation of UI, you will have to program a way to save the current constellation into some config file and on reopening that constellation rebuilding that from the config file.

Rolf Kalbermatter
My Blog
0 Kudos
Message 7 of 11
(3,390 Views)

What did you do when you "save" ?

You can use invoke node "Reinitialize To Default" to make those indicators show default values.

 

LabVIEW doesn't support child window.

SubVIs are NOT child windows unless you call Windows API to make them child windows.

Are you make Windows API calls with Call Liberary Fuction Node (CLFN) ?

 

Sorry I have to ask.  You didn't give enough information.

 

 

George Zou
0 Kudos
Message 8 of 11
(3,361 Views)

SubPanels, (since about LabVIEW 7) are not the same as subVIs although you place VIs in them. They are pretty good to implement something akin parent-child Windows but fully LabVIEW native.

Rolf Kalbermatter
My Blog
0 Kudos
Message 9 of 11
(3,351 Views)

Hi rolfk,

 

            I tried saving and loading the child vis, but no success. Do u have any example, so that i can clearlz understand how to do it? Or any other ideas pls do tell me.

0 Kudos
Message 10 of 11
(3,196 Views)