Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

Use a pushbutton to switch between Lookout and NI MAX

I would like to switch to NI MAX to view my alarm history from Lookout. This is for a touchscreen computer without a keyboard. ALT+TAB would work but cannot seem to make this work with a pushbutton in Lookout.
0 Kudos
Message 1 of 3
(3,134 Views)
Hi,

You can call MAX from Lookout by using the Run object, in the command line to be run you need to specify the following path :

"C:\Program Files\National Instruments\MAX\nimax.exe"

Then, you could connect a pushbutton to activate the Run Object. The only disadvantage of this method is that every time you activate the pushbutton the Run Object will open a new instance of MAX, even if you already have one open.

Best Regards


Andre Oliveira
0 Kudos
Message 2 of 3
(3,134 Views)


Hi,

Using the Run object directly with NIMax.exe will launch a new instance of NIMax each time - probably not what you want. However, to just "activate" or to bring-to-front the already-launched NIMax you can do the following:

Write a Script which will "activate" (brings-to-front) the NIMax. Then use the Run object in Lookout to run this Script.

There are two ways you can Script this task using Windows Script Host, for instance:

1. Use the AppActivate mehtod -- you pass the Title of the window ("Measurement & Automation Explorer" in our case) with the method. On execution of the script, the NIMax is made active. The only catch here is that the NIMax window must not be minimized to an Icon on the task bar
(it should be open; but can be behind your Lookout panels).

2. Actually simulate the Alt+Tab keys from the Script. The SendKeys method does just that -- sends the keys (Alt+Tab, in our case) to the system. The catch here is that this may open some other "third" Window if there happens to be one. Just like Alt+Tabbing would do if there are more windows.

I am attaching the two scripts; both of which have been tested to work fine.

NOTE the funky command with bunch of double-qoutes you need to use with the Run Object in Lookout:

"""WScript.exe"" ""C:\lookout5\Lookout 5.0\nimax.wsf"""

The above command worked in my case. See the following KB article as to why we need all these double-qoutes:

Using Lookout to Open an Application and a File in the Application

And see the following for more info' on .microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsoriWindowsScriptHost.asp>WSH S...

Hope this helps.

Regards,

Khalid 🙂


Download All
Message 3 of 3
(3,134 Views)