Bringing Wonderware SMC to foreground

SouthernStang

Member
Join Date
May 2019
Location
Alabama
Posts
28
If have a need (trust me its a need) to bring the System Management Console to the foreground while the HMI is running.

I am trying to to this VIA an InTouch button and action script. As a test, I have been able to bring a number of random apps to the fore ground using the following code...

ActivateApp InfoAppTitle ("aaIDE");

In the example above it brings Archestra IDE to the foreground.

When I try to bring the SMC to the foreground ("aaSMC") nothing happens. I did notice that in task manager the SMC runs under the MMC (Microsoft Management Console) so that may be why its not working.

Do you guys happen to know how to bring the SMC.. or anything running in the MMC to the foreground via a windows script?

Thanks
 
Here is what I use to call the MS Calculator with a button.
Maybe you want to try "StartApp"?

CalculatorIsActive = InfoAppActive("Calculator");
AppTitle = "Calculator";

IF CalculatorIsActive == 1 THEN
ActivateApp AppTitle;
ELSE
StartApp "C:\Winnt\System32\Calc.exe";
ENDIF;
 
Start app works except if the SMC is already running it creates another instance. Im not sure if this is what I want... im concerned that it may "reload" the PLC addresses in the new instance and that would mean both of the SMC could possibly show different info.

Please let me know if this isnt the case
 
Start app works except if the SMC is already running it creates another instance. Im not sure if this is what I want... im concerned that it may "reload" the PLC addresses in the new instance and that would mean both of the SMC could possibly show different info.

Please let me know if this isnt the case

SMC is running in realtime, so more than 1 instance should show same data.
But let me see if we can get it to work with Activate APP.

You will still need parts of my script to start it with StartApp, use a count to show it is active, and then bring to front again with ActivateAPP.
 
Using your code I have:

SMCISActive = InfoAppActive("aaSMC");
AppTitle = "aaSMC";

IF SMCISActive == 1 THEN
ActivateApp AppTitle;
ELSE
StartApp "C:\Program Files (x86)\Common Files\ArchestrA\aaSMC.exe";
ENDIF;

Using this code always launches a new instance of the SMC so its only executing the else statement.
 
You cannot run SMC.exe across mmc, because it is not a *.msc console file.
You want to open "smc.msc", not aaSMC.exe. This will open SMC inside mmc console.

try it.. even from run line.
 
Last edited:
Thanks a ton for that...

you are right from command line, i can type smc.msc and it open the SMC but it open multiple instances. the result is the same if I use StartApp"C:\Program Files (x86)\Common Files\ArchestrA\aaSMC.exe"; in a InTouch script.

I am beginning to think that is the only way to do it. The one thing that give me hope right now is i can right click on it in task manager and select bring to front and it brings the current session to the front like i was wanting... just need to figure out how to do that.
 
You cannot run SMC.exe across mmc, because it is not a *.msc console file.
You want to open "smc.msc", not aaSMC.exe. This will open SMC inside mmc console.

In your script, change "aaSMC" to "smc.msc" (excpet for AppTitle)

StartApp should be ["StartApp "smc.msc"] no brackets.
 
Last edited:
Correct, that is what i have done"

IF InfoAppActive(InfoAppTitle("smc.msc"))==1 THEN
ActivateApp InfoAppTitle("smc.msc");
ELSE
StartApp("smc.msc");
ENDIF;

Its still opening multiple sessions... so I am guessing its executing the else statement.
 
Try this one...

SMCisActive = InfoAppActive("SMC");
AppTitle = "SMC";

IF SMCisActive == 1 THEN
ActivateApp AppTitle;
ELSE
StartApp "smc.msc";
ENDIF;
 
More info... from help

"apptitle"
The application title or Windows task list of the application for which you want to query the running status. A literal string value, message tagname, or string expression.

InfoAppTitle() Function
Returns the application title or Windows task list name of a specified application that is running.

Syntax

result = InfoAppTitle (appname)Parameters

appname

Name of the application without the .exe extension. A literal string value, message tagname, or string expression.

Example(s)

This script returns "Calculator"

InfoAppTitle("calc")This script returns "Microsoft Excel"

InfoAppTitle("excel")Related Topics

Retrieving the Application Title of a Running Application



SO it looks like apptitle must match be what windows references the SMC as??
 
Last edited:
Retrieving the Application Title of a Running Application
In a script, you can find the application title or Windows task list name of a specified running application by using the InfoAppTitle() function. This information is, for example, required by InTouch scripting for checking if the specified application is currently running or for activating it.
 
Yeah, I tried that one earlier. I even tried using the actual title in the title bar (SMC - [ArchestrA System Management Console]")The issue as I see it is that the apptitle is the name as its listed in task manager...

IE

Internet explorer = iexplorer
Task Manager = Taskmgr

etc.

But since the SMC is running 'inside' of the mmc it cant seem to find the name SMC or aaSMC its just comes up blank.
 

Similar Topics

Hi all, I have picked up a job where the previous automation guy selected some Freewave Radios (WC20i-485 into WC45i stick gateway) to transmit...
Replies
17
Views
5,733
I am not very experienced (2 yr) so this question is for people who know both what is going on with data science currently and have experience...
Replies
0
Views
1,106
Hi guys, While trying to upgrade a Siemens MP370, it hung somewhere in the process and gets about halfway through the creation of its disk...
Replies
4
Views
2,770
I'm fairly well-versed in programming GE 90-30 PLCs with Proficy ME, but I can't figure out how to open a project that was created on a different...
Replies
4
Views
9,840
Can you use an existing OPC over Industrial Ethernet connection to update code on a S7-300 PLC using Siemens Step 7? I found something somewhere...
Replies
1
Views
3,112
Back
Top Bottom