LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

deactivate VI panel and activate another Window application

Hi, LVers, 

 

My program requires two windows applications. One is labview VI panel, the other one is a non-labview application, for example, Windows Notepad.

 

I want to programabally deactivate the VI panel (either by minimizing it or keeping it unchanged) and activate the Notepad window. When the process in Notepad finish, the VI panel window is activated again and the Notepad window is deactivated.

 

Any suggestions? My LV is 8.5.

 

 

  

 

0 Kudos
Message 1 of 9
(3,841 Views)

How the VI will know when the notepad operations have finished ?

When it is closed, or maybe when a key is pressed (like F12) ?

 

qq.png

 

Search for "lvwutil32", for handling other windows applications

Message 2 of 9
(3,829 Views)

Pnt wrote:

How the VI will know when the notepad operations have finished ?

When it is closed, or maybe when a key is pressed (like F12) ?

 

qq.png

 

Search for "lvwutil32", for handling other windows applications


 

(pssst...  Sysexec >>> run notepad and wait for it to complete).

 

Ben

Message Edited by Ben on 11-09-2009 02:57 PM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 9
(3,825 Views)

Sorry, I just use Notepad as a simplification. 

 

Acutally my program use LabVIEW to control the LaVision high speed CCD.  The CCD is drived by its own windows application DAVIS.

 

Meanwhile, DAVIS works as an DDE server though which my LV can access low-level command to customize CCD. 

 

When the process in DAVIS start, I want DAVIS window to be activated and the LV is deactivated. When the precess at DAVIS finish, LV will be notified. Then DAVIS window will be deactivated and the LV panel gets activation again.

0 Kudos
Message 4 of 9
(3,821 Views)

Hi, Pnt

 

Thanks for your reply.

 

I have tried your method as shown in the picture.

 

The VI is hiden as expected. However, the notepad window is not activated after the VI is hiden. The VI still holds the Activation although it is invisible.

 

 

 

0 Kudos
Message 5 of 9
(3,805 Views)

The rest of your solution is Ben's post.

Use the System execution vi, to run Notepad (for example) with the option "Wait until completition" set to True.

When you close notepad , the vi will continue.

Then you will have to make the front panel visible again by changing the "hidden" option in my picture

Message 6 of 9
(3,790 Views)

Thanks Pnt.

 

 

Your suggestion is good but still can not meet my requirement.

 

I have two applications running together. One is VI panel and the other one is Notepad. They will be lunched manually and kept co-existing until being closed manually.

 

During labview execution, the VI panel and Notepad need to switch window activation between each other, means when the task at Notepad finishes, Notepad lost its activation (application is not closed, just wait) and the VI panel gets window activation. Then when the task at VI finishes (VI panel is not closed, just wait), VI lost window activation and the Notepad get back window activation again. So on and so forth.

 

Thanks.

0 Kudos
Message 7 of 9
(3,756 Views)

mowr wrote:

Thanks Pnt.

 

 

Your suggestion is good but still can not meet my requirement.

 

I have two applications running together. One is VI panel and the other one is Notepad. They will be lunched manually and kept co-existing until being closed manually.

 

During labview execution, the VI panel and Notepad need to switch window activation between each other, means when the task at Notepad finishes, Notepad lost its activation (application is not closed, just wait) and the VI panel gets window activation. Then when the task at VI finishes (VI panel is not closed, just wait), VI lost window activation and the Notepad get back window activation again. So on and so forth.

 

Thanks.


 

With that clarification I have to quote from Pnt's post #2 above "Search for "lvwutil32", for handling other windows applications" That set of utilities has been discussed many times on this forum (please search) and will let you monitor the states of apps running under Windoze.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 8 of 9
(3,752 Views)

Why don't you have two seperate threads. One while loop that calls notepad and another that controls your front panel. Then use register events. When notepad is done, it registers an event that activates your front panel. When front panel is done, it activates an event that brings notepad back up. This is an incredibly sloppy example (1. I don't use register events much. 2. Time crunch.) However, maybe someone can expand on this or you can use it as a starting point.

Edit: Wow my error wires!!! Pls ignore 🙂
Message Edited by for(imstuck) on 11-10-2009 09:19 AM
0 Kudos
Message 9 of 9
(3,747 Views)