Triggering an application on client OS via mapp View

Hello community,
We have an X20 CPU + 5PPC1200 hardware conf. and mapp view HMI is running in the system.
Besides using the 5PPC1200 as a mapp view client, there are a couple of applications installed on 5PPC1200 such as TeamViewer, IP Camera, and so on. The question, is it possible to trigger to open an application installed on the client side over mapp View pages?
In other words, can we trigger to open the Team Viewer installed on the 5PPC1200 by a button located on mapp View?

Thanks,
Irfan

Hi,

as I know this is not possible, it’s “forbidden by system design” (not from mappView design).

For security reasons, a browser acts like a sandbox for any content rendered and executed in the browser itself: and it’s not allowed for a browser to have a direct trap to the host operating system and to execute any functions there.

Of course, almost everything is “thinkable”: for example, if you’re able to write a program/script for your PPC’s operating system (I assume it’s Windows or Linux), that

  • is able to communicate with the PLC (e.g. by OPC UA, or TCP/UDP socket), and
  • is able to start / execute a program

then it would be possible to set inside mappView a PLC variable that triggers the own communication implementation between PLC and PPC operating system, and the PPC OS starts then the program on the OS level.

Best regards!

4 Likes

I have found an internal memo shared by Job Franken which answers my question creatively. I have tested the steps myself and it is working fine. I am sharing the details as a summary with his approval.

Introduction
In Windows there is a feature that a custom URI scheme can be registered, so that an application (the browser in this case) can invoke another application.

Step 1 - Modify the Windows register
In this example, the On Screen Keyboard is going to be launched from mapp View.
The modification needed is an addition to the HKEY_CLASSES_ROOT.
See next screenshot. This should be the result of the modification, the contents within the red square.


Figure 1, screenshot from the registry. The red square shows the final result that should be added for this feature to work

The first key is the name of the URI Scheme and in this example: “ApplicationStartVK”. Please check on beforehand if the name is not already in “HKEY_CLASSES_ROOT”.

In “ApplicationStartVK”, the default value should be;
image
Then the string value URL Protocol is added and should be empty.

At the key “DefaultIcon”, the default value should contain %1” (just one quote at the end)
image
Figure 2, DefaultIcon should have value %1"

“Shell” and “Open” do not have values, leave default.

Next, at “Command”, the address of your application should be filled in.


Figure 3, at the key command, fill in the path of the executable in the default value

Step 2 - Call the URI in the WebViewer Widget
The WebViewer Widget can be used to embed a website into the mapp View visualization.

image
Figure 4, screenshot of the content viewer and the Properties window in Automation Studio

Disable the “useURL” property of the WebViewer Widget
To camouflage the WebViewer on the screen in the browser, disable the visibility
At property “src”, fill in the URI, with the colon:
image

For the example used in this HowTo, the URL needs to be:
image

Step 3 - Result
When the WebViewer widget is loaded, the following message is displayed:


Figure 5, message that is displayed after the URL is opened

9 Likes

Nice post, very useful. Is there a way to close an opened application with this method. I would like to have a way to close Chromium browser with a button since I run it in kiosk mode. Thanks!

Since you can define it yourself, you should be able to program your own application (using C# or python ?!) and evaluate the opened url there. So you can have different commands, one for opening, and one for closing chrome e.g.

The whole URL seems to be passed to your application for which the URI is registered.

Best regards

As Marcel suggested, another option might be the sample mappRemoteShell on GitHub. The way this works is:

  1. A Python script runs in Windows and can execute commands
  2. The Python script connects to a B&R target via OpcUA
  3. The B&R target can send OpcUa commands to the Python script which are then executed in Windows

Of course this comes with some things to consider, such as

  • The Python script must be running in order for any of this to work, and
  • It is a bit of a security risk in that anyone who can access the OpcUa communication can also trigger things to happen in Windows via the Python script
2 Likes

I have the same needs, one is to close chrome because of kiosk mode and the other is to close the windows
system, I don’t know if you have any good idea now