openAES()

Opens the alert and event panel at the desired position and allows executing an action such as print the upper table of the alert and event panel or save the table.

Synopsis

int openAES(string screenConfig, string module, int action, [string fileName], int xPos, int yPos);

Parameter

Parameter Meaning
screenConfig Name of the screen configuration. Here you specify the name of the screen configuration from the table configuration panel, for example, "aes_default". You can also use a self-created configuration.
module

Name of the module in which the alert and event panel should be opened. The default value is "WinCC OA AES". Therefore, if you do not specify a module name, the module name "WinCC OA AES" is used.

You can specify the value TRUE instead of module name and the alert and event panel is opened onTop (the alert and event panel always remains the topmost panel). If you again specify the value FALSE, the alert and event panel is opened notOnTop (other panels can be shown on the foreground although the alert and event panel is open). If the parameter is not empty (a module name is specified) and is not TRUE or FALSE, the module name is used.

openAES("aes_default") // Opens the panel according to the settings

openAES("aes_default", TRUE) // Opens onTop

openAES("aes_default", FALSE) // Opens notOnTop

openAES("aes_default", "HUGO") // Opens the panel according to the settings, in the module HUGO

action

The action that should be executed. The action is specified as a constant. Possible constants are:

const int AES_ACTION_INTERACT = 0; // Default mode

const int AES_ACTION_AUTORUN = 1; // Opens the alert and event panel continuously

const int AES_ACTION_PRINT = 2; // Prints the upper table of the alert and event table.

You can print a table only in closed mode. This means that you have to select a closed mode in the Properties of the alert table panel and save this configuration. In the Table configuration panel you then select this configuration for the option "Properties" on the General AES settings tab.

const int AES_ACTION_SAVE = 3; // Allows to save the alert and event panel

The constants are located in <version_path>/scripts/libs/aes.ctl

fileName The file name of the file that should be printed. You have to use a relative path. The files that are saved via the alert and event panel and that can be printed are located in <proj_path>/data.
xPos The x position of the panel, for example, 200. openAES(screenConfig, module, action," ",200,100 )
yPos The y position of the panel, for example, 100 openAES(screenConfig, module, action," ",200,100 )

Return Value

Normally 0, in case of errors (when a screen configuration has not been found) -1.

Errors

When a screen configuration has not been found.

Description

Opens the alert and event panel.

Example

The following example opens the alert and event panel.

main()
{  
  string screenConfig, module, fileName;  int action = AES_ACTION_PRINT; 
  // Prints the table  screenConfig = "config";  
  /* Screen configuration from the panel table configuration 
  */  module = "Vision_2";  /* Name of the module in which the alert and event panel should be opened   
  */ fileName = "table1";  /* Name of the file that should be printed. The files that are saved 
  (and can be printed) via the alert and event panel are located in <proj_path>/data 
  */ openAES(screenConfig, module, action, fileName);  DebugN("Function was successfully executed");
}

Assignment

Alert and event panel, Alert handling

Availability

CTRL

See also