pmonGetState()
The function pmonGetState() returns the manager state of a WinCC OA manager.
Synopsis
int pmonGetState(int idx);
Parameters
| Parameter | Description | 
|---|---|
| idx | The WinCC OA manager index. See chapter Details on the Pmon | 
Return value
The function pmonGetState() returns the manager state of a WinCC OA manager or in the event of errors, -1.
Description
The function pmonGetState() returns the manager state of a WinCC OA manager. The state is shown in the WinCC OA console.
Figure: WinCC OA console and manager states
                
            
NOTE that the function can only be used on a local computer. A remote UI cannot query the PMON of a server.
EXAMPLE
In the following example, the names as well as the manager states of WinCC_OA managers are returned and output.
main(mapping event)
{
  string pName;
  int i, pState;
  for (int i = 0; i < pmonGetCount(); i++)
  {
    pState = pmonGetState(i);
    pName = pmonGetName(i);
    DebugN("Manager name: ", pName, "Manager state:", pState);
  }
}
            The function outputs the names as well as the states of the managers as follows:
WCCOAui2:["Manager name: "]["WCCILpmon"]["Manager state:"][2]
WCCOAui2:["Manager name: "]["WCCILdata"]["Manager state:"][2]
WCCOAui2:["Manager name: "]["WCCOAvalarch"]["Manager state:"][2]
WCCOAui2:["Manager name: "]["WCCOAvalarch"]["Manager state:"][2]
WCCOAui2:["Manager name: "]["WCCOAvalarch"]["Manager state:"][2]
WCCOAui2:["Manager name: "]["WCCOAvalarch"]["Manager state:"][2]
WCCOAui2:["Manager name: "]["WCCOAvalarch"]["Manager state:"][2]
WCCOAui2:["Manager name: "]["WCCOAvalarch"]["Manager state:"][2]
WCCOAui2:["Manager name: "]["WCCILevent"]["Manager state:"][2]
WCCOAui2:["Manager name: "]["WCCILproxy"]["Manager state:"][2]
WCCOAui2:["Manager name: "]["WCCOActrl"]["Manager state:"][2]
WCCOAui2:["Manager name: "]["WCCILsim"]["Manager state:"][2]
WCCOAui2:["Manager name: "]["WCCOAui"]["Manager state:"][2]
WCCOAui2:["Manager name: "]["WCCOActrl"]["Manager state:"][0]
WCCOAui2:["Manager name: "]["WCCOActrl"]["Manager state:"][2]
WCCOAui2:["Manager name: "]["WCCOAui"]["Manager state:"][2]
        Assignment
PMON functions.
Availability
UI