Page 1 of 1
How to find out that the code are running in the Desktop UI?
Posted: Mon Dec 14, 2020 8:49 am
by philipp.wechsler
We need to stop the system calls in the Desktop UI and need a query if the code is running under a Desktop UI.
How to find out that the code are running in the Desktop UI? Similar to isUltralight( ).
Currently I solve it like this:
Code: Select all
string user, password;
bool isDesktopUi = ( getMobileUserInfo( user, password ) == 0 );
Re: How to find out that the code are running in the Desktop UI?
Posted: Mon Dec 14, 2020 5:14 pm
by leoknipp
There is no dedicated function available to get the information if a Desktop UI is used.
As most of the time the Desktop UI is started on a machine which is not a WinCC OA server you can possibly compare the information for eventHost() with the local host name. If the names do not match a remote UI is started.
Best Regards
Leopold Knipp
Senior Support Specialist
Re: How to find out that the code are running in the Desktop UI?
Posted: Wed Dec 16, 2020 7:15 am
by philipp.wechsler
What about the client? In the client, the local host and eventHost() are also already different. Although it does not run in the Desktop UI.
Best Regards
Philipp Wechsler
Re: How to find out that the code are running in the Desktop UI?
Posted: Wed Dec 16, 2020 9:27 am
by gschijndel
I check if the result of 'getActiveHttpServerUrl()' is not empty to determine if running in a DesktopUI.
Re: How to find out that the code are running in the Desktop UI?
Posted: Thu Dec 17, 2020 8:55 am
by leoknipp
Why do you want to make a difference between a normal client UI and a Desktop-UI?
A Desktop-UI is more or less the same like a normal Runtime UI with a simplified installation and a simple project administration.
Best Regards
Leopold Knipp
Senior Support Specialist
Re: How to find out that the code are running in the Desktop UI?
Posted: Fri Dec 18, 2020 4:05 pm
by philipp.wechsler
System calls such as opening the GEDI do not work in the Desktop UI. But it works for normal client. That's the reason why we don't want to offer such functions under Desktop UI at all.
Re: How to find out that the code are running in the Desktop UI?
Posted: Fri Dec 18, 2020 4:42 pm
by philipp.wechsler
@gschijndel yes, your solution do the same! Thanks for your reply.
Re: How to find out that the code are running in the Desktop UI?
Posted: Fri Dec 18, 2020 5:16 pm
by leoknipp
With the information given by the CTRL constant WINCCOA_PATH you can also determine if a Desktop UI is used as the Desktop UI is installed in a fixed path.
E.g. for WinCC OA 3.17: C:/Siemens/Automation/WinCC_OA/DesktopUI/3.17/
Best Regards
Leopold Knipp
Senior Support Specialist
Re: How to find out that the code are running in the Desktop UI?
Posted: Mon Dec 21, 2020 7:43 am
by philipp.wechsler
Thanks @leoknipp, with your solution it works as well.
Best Regards
Philipp Wechsler