Details on the Pmon

This chapter is intended for advanced WinCC OA users who want to find out more about the debugging possibilities and further information about the Pmon.

Debug-Levels

In order to trace possible sources of error during the actions you can use the command line options for debugging. Information on all further options can be queried via helpdbg (see also Manager options).

Debug level Description
-dbg 2 Prints detailed information about the Pmon.
-SNMP Show SNMP debug info.
-report all Shows the current status of all managers, the current Pmon status as well as the TCP connections built at the moment.

Command line options of the Pmon

In addition to the default command line options (e.g. -report, -help,...) there are additional specific options for the Pmon for administration of a WinCC OA project.

Option Description
-auth <olduser> <oldpassword> <user> <password> Sets a user and the appropriate encrypted password into the progs file. The password is necessary to access the Pmon per HTTP. To delete the user/password "" has to be specified as a new value. The specified user always has to match. If the password specified in the progs file is empty you do not need a password. For changing the password the user and the old password have to be specified.
-command

Allows to run Pmon commands using the command line. Syntax and available command can be found here: Commands for the specific Pmon protocol.

Note

If the user and password are not required for the command the elements "##" can be skipped, e.g. -command START_ALL" instead of "-command ##START_ALL". Further the separator ":" must only be stated if a command requires a subcommand, e.g. "-command SINGLE_MGR:START 1".

-helpcommand Returns a list of all available commands. See also Commands
-n, -noAutostart Prevents the automatic start of the WinCC OA project and starts the Pmon in the WAIT_MODE.
-port <portNum> Defines the server port for the TCP commands.
-status

The return value specifies whether a Pmon already runs for this project: 0= Pmon runs, 3 = Pmon stopped,4 = unknown.

Not available if the Pmon is started as service.

-stop

If a Pmon already runs for this project the Pmon and the whole project are stopped.

Not available if the Pmon is started as service.

-stopWait

Like -stop but the system waits as long as the whole project is stopped and the Pmon stopped.

Not available if the Pmon is started as service.

Commands for the specific Pmon protocol (pmon_query())

Via these commands the whole PmonTable can be queried and changed via the specific Pmon protocol at the TCP server port. The structure of a command looks as follows:

user#cleartextPassword#<command>:[<subcommand>[<arguments>]]

"subcommand" and "arguments" are optional. The brackets are not part of the message. An example of a command:

SINGLE_MGR:START 3

The further commands are listed in the following table:

Command Sub command Description
START_ALL Starts the project (only allowed in the WAIT_MODE mode).
STOP_ALL Stops the project (beginning from the last manager until the first manager).
RESTART_ALL Stops the project and restarts it (only allowed in the WAIT_MODE mode).
SINGLE_MGR Commands for single managers with following sub commands:
START <idx> Starts the manager with the index <idx> (beginning from 1, since the Pmon has index 0).
STOP <idx> Stops the manager with the index <idx>. Kill -15 is tried.
KILL <idx> Stops the manager with the index <idx>. Kill -9 is tried.
DEL <idx> Deletes the manager with the index <idx> from the Pmon table and thus also from the progs file. This is only allowed when this and all following managers are stopped.
INS <idx> <manager> <startMode> <secKill> <restartCount> <resetMin> <commandlineOptions> Adds a new manager to the desired position. This is only allowed when this and all following managers are stopped.

PROP_PUT <idx> <startMode> <secKill> <restartCount> <resetMin>>

<commandlineOptions>

Changes the monitoring parameter for the manager with the index <idx>.

Specify the start mode as word (once, manual, always).

PROP_GET <idx>

Queries the current settings. The reply to this command is structured as follows:

<startMode> <secKill> <restartCount> <resetMin> <commandlineOptions>

DEBUG <idx> <arguments> Sends the <arguments> like a killdbg to the specified manager.
MGRLIST Commands for listing the managers with following <subcommands>:
LIST

Returns the defined managers in the following format:

LIST:<count>

<manager>;<startMode>;<secKill>;<restartCount>;

<resetMin>;<CommandlineOptions>

....

;

STATI

Returns the status of all defined managers in the following format:

<state> ... 0 (stopped), 1 (init) or 2 (running), 3 (blocked)

<PID> ... Process ID numeric

<startMode> ... 0 (manual), 1 (once), 2 (always)

<startTime> ... e.g. 2003.03.25 17:06:07.123

<manNum> ... Manager number (is partly assigned by the Data manager).

The status "blocked" is identified by the pmon only in the monitoring mode.

LIST:<count>

<state>;<PID>;<startMode>;<startTime>;<manNum>

<state>;<PID>;<startMode>;<startTime>;<manNum>

...

<mode_numeric><mode_string>

<emergency_active_numeric>

<demoMode_active_numeric>

;

The line <mode_numeric> <mode_string> <emergency_active_numeric> <demoMode_active_numeric> shows the current Pmon mode self (numeric and as text) and the emergency mode with 0 (not active) or 1 (active) and the demo license mode with 0 (not active) or 1 (active).. e.g. "0 START_MODE 0 1"

The last line consisting of only ";" shows the end of the list.

PROJECT

Returns the name of the project the Pmon serves.

Commands that have an effect on the progs file automatically generate a new progs file so that these changes are kept synchronous in the shared memory and in the progs file

For detailed information on the use of these commands for the specific Pmon protocol in CTRL scripts, open the library <wincc_oa_path>/scripts/libs/pmon.ctl, which contains the functions for working in CTRL (e.g. insert/delete/edit a manager in the console).

For some functions, you have to indicate the index of the manager that you want to approach. The numeration of the index for the managers that the Pmon can operate starts with 1, since the Pmon itself has the index 0. In the last column of the console, the index of each manager is displayed (see the following figure). However, in this case the numeration starts with 1 (Pmon). Therefore, you have to use "index of console -1" for the functions in the pmon.ctl script.

Deactivating Windows info dialogs which pop-up when a process is stopped

It may happen that Windows dialogs are opened when a WinCC OA process (manager) is stopped. Thus, the process will run as long as the dialog is not confirmed.

Such dialogs can be, for example:

  • Send dialogs to Microsoft
  • Debugger dialogs if a debugger is installed

  • Other dialogs containing information about the stopped process

The pop-up of such dialogs can possibly be deactivated by performing one of the following Windows configuration adjustments:

Changing the Registry setting DontShowUI
  1. Press Win+R key to launch the Run box, type "regedit" and click OK.
  2. Navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\Windows Error Reporting\.

  3. Double click on DontShowUI at the right pane and set the value data to 1.

  4. If this setting can not be found there try to find it under HKEY_CURRENT_USER\Software\Microsoft\Windows\Windows Error Reporting\.

  5. Restart your computer.

Changing the Registry setting ErrorMode
  1. Press Win+R key to launch the Run box, type "regedit" and click OK.
  2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows\.

  3. Double click on ErrorMode at the right pane and set the value data to 2.

  4. Restart your computer.