LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Child window refresh issue with LabVIEW 8.0

Hi smercurio...

No this version serves to completely lock up LabVIEW on my PC..., although the refresh issue didn't appear to be a problem.

I think I'm going to abandon this attempt for now, because I am spending way too much time on it, and the potential value added to enhance my program really isn't that much.  I have currently integrated most of my other panels using LabVIEW 8.0's subpanel feature, and combined that with the tab structure.  That'll work for now.

In the meantime, if you think of something, or run across something, send me a message, as this is eventually something that I would like to employ, if possible.

Thanks,

DJH

0 Kudos
Message 11 of 26
(1,826 Views)

Well, the good news is that I finally got this one working to my liking... I went back a revision or so, using smercurio...'s first update.  Since I had a refresh issue that only occurred when the window was being redrawn, I opened the VI 'hidden', and then once the initialisation was complete, I displayed the VI.  This seems to have resolved the issue with no noticeable glitches.

The only disadvantage I have is that this VI is now wholly part of the main VI (looking into the code, this is necessary to incorporate the parent/child relationship).  Opening the VI hierarchy shows it to be wholly dependant upon the main VI, and no longer in parallel with the main VI.  However, knowing this, I can now use this method whenever I want something displayed in conjunction with the main VI.  So, problem solved from my end.

I am attaching my final version, in case anyone else with a similar problem finds this thread.  As always, any suggestions for improvement are always welcome.  Thanks all for your help!

DJH

0 Kudos
Message 12 of 26
(1,822 Views)
Hmm... not quite sure why it would lock up LabVIEW, as I didn't have a problem with it. If I have some time I might tinker with it, as this question comes up quite a bit. Still, you are trying to do something for which LabVIEW wasn't designed so you can't expect miracles.

Your later post seems to imply that you're confusing the concept of the VI hierarchy with the window parent/child relationship. These are independent. The VI hierarchy shows you what is a subVI of something else. It shows you the linkage dependencies. This has nothing to do with one window being displayed inside the frame of another using the Windows calls as this is basically overriding LabVIEW's windows management. If you have a "Main.vi" VI which opens "subVI.vi" dynamically and "subVI.vi" is not in the block diagram of "Main.vi" (or any of its subVIs), then if you have both "Main.vi" and "subVI.vi" open and view the Hierarchy you will see them as separate. This doesn't mean that you can't use the Windows calls to place "subVI.vi" inside the frame of "Main.vi" when it's running.
0 Kudos
Message 13 of 26
(1,821 Views)

Hi smercurio...

No, I did not mean to imply that... pretty much the way you explained it is what I meant.  When I looked at what was actually happening in the hierarchy window, it confirmed what the code was actually doing.

Anyway, if you do have time, I'd like to hear what you come up with.  In and of itself, my code is working for me as-is.  The next step would be for me to integrate it into my main program.

Thanks again!

DJH

0 Kudos
Message 14 of 26
(1,817 Views)

What LabVIEW fx allows one to get the window handle for a child window?  Any better ways to make a child window since your posts back in March?

Thanks,

Don

0 Kudos
Message 15 of 26
(1,733 Views)
I had to go back and reread this thread as it was a while ago and I had to look at the code again. The issue was never with getting the window handle. Rather, once the parent-child relationship was created, the child window wasn't getting refreshed. It wasn't clear whether this was a LabVIEW problem or a Windows problem. The modified "Create Child Window" VI that I had posted worked just fine on my computer and accomplished what the poster was trying to do, as far as I could tell. Unfortunately, the poster said it crashed their machine, and it was never determined why. I couldn't get it to crash (and still can't), so I don't know what the problem was.
0 Kudos
Message 16 of 26
(1,729 Views)
Well I want to try it on my machine.  But one of the VI input terminals is for the window handle of the child window.  What is the fx necessary to obtain the window handle of the child window?....thanks, Don
0 Kudos
Message 17 of 26
(1,726 Views)
You can use Get Window RefNum.vi (lvwutil32)
 
Take a look its diagram, the dll call returns a window handle, which typecasted to Refnum.
 
 
George Zou
 
George Zou
0 Kudos
Message 18 of 26
(1,718 Views)
If you want to try the consolidated code, I revisited it and modified a few functions to streamline it a bit more. See attached zip file.
0 Kudos
Message 19 of 26
(1,712 Views)

I remembered many years ago some child window code I had used to place IMAQ Vision Windows within a parent VI window, and along with your suggestions and George's, I put together this VI (see attached). It is simpler than yours in the sense I do not need the positioning and refreshing.  It works great! Except........it crashed LabVIEW (see the error I pasted directly into the VI diagram) when I stopped running the program.  Without the parent-child code, the code performs an orderly shutdown of stopping all VIs and closing all front panels (including the parent VI window) using generated User Events that visit each open VI window. 

This gets confusing but I will try to explain. My thoughts were that there was a clash going on between closing these windows and the closing of the parent window that contains these now child windows.  So I altered my exiting code so the parent VI user event stop is not generated until after all the other user events to stop the child windows are generated.  That seemed to work.  So the bottom line is, probably don't stop the parent window until all the child windows are stopped.  (I am also assuming, although I have not tested, that just closing a parent window does not STOP all the child VIs from continuing to RUN - i.e., they must be formally stopped as is normal with LabVIEW VIs).

Sincerely,

Don

 

0 Kudos
Message 20 of 26
(1,703 Views)