pmonGetState() reports 0 for all managers when started from UI and the project is running as a service

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
Search

Post Reply
3 posts • Page 1 of 1
daniel.ponader
Posts: 34
Joined: Tue Jan 10, 2012 1:40 pm

pmonGetState() reports 0 for all managers when started from UI and the project is running as a service

Post by daniel.ponader »

We want to use pmonGetState() to show the operational state of a control manager within a status panel on a project which is running as service on a windows machine. If the same project is running in "normal" mode pmonGetState() reports the manager states correctly in the UI. If pmonGetState() is executed within a control manager it's also working as aspected. Is there a possibility to get the state of manager for an UI running on an project which is configured as a service, besides excuting pmonGetState() in a separate control script?

Thanks & Regards
Daniel

gschijndel
Posts: 373
Joined: Tue Jan 15, 2019 3:12 pm

Re: pmonGetState() reports 0 for all managers when started from UI and the project is running as a service

Post by gschijndel »

The pmonGetState read the state from a shared memory (see api/include/Basics/NoPosix/PmonTable.hxx). Unfortunately this shared memory is not created in the global namespace, so it is only available in the same session as the service (session 0).

There are commands available, which can be used to get the state of all managers. These commands can be executed with the pmon '-command' option or with the function 'pmon_query2'.

User avatar
leoknipp
Posts: 2926
Joined: Tue Aug 24, 2010 7:28 pm

Re: pmonGetState() reports 0 for all managers when started from UI and the project is running as a service

Post by leoknipp »

Please take into account that the CTRL function pmon_query() is an internal (undocumented) function.
We recommend to use only functions which are listed in the WinCC OA Documentation.
When using undocumented functions you must ensure that all prerequisites are fulfilled on your own.

Best Regards
Leopold Knipp
Senior Support Specialist

Post Reply
3 posts • Page 1 of 1