Optimization of WinCC OA
The program part of some managers contains certain control instructions. These are called up at regular intervals by the internal work() function. Each call executes a certain number of CTRL instructions. The more instructions are executed in a work() call, the quicker CTRL functions will be processed. This delays executing other parts of the program such as formatting the screen of the user interface and can have a widely differing influence on the performance of WinCC OA, depending on what operating system and hardware platforms are being used.
In the file config, setting ctrlMaxWeight optimizes performance of WinCC OA. The standard setting is 5000 in the [general] section. Values of other valid sections overwrite the value in the [general] section.
The ctrlMaxWeight keyword can be set in the following sections:
[ui] Default = 30,
[ctrl] Default = 10000 and
[event] Default = 500
Syntax:
ctrlMaxWeight = <aWeight>
To obtain a rational value for <aWeight>, the program has an avgSmentTime() function from libCTRL.ctl. This function helps to determine the influence of the platform and operating system used, irrespective of the entry ctrlMaxWeight. Assuming a maximum time Tmax that should be used as the control in work(), one can calculate the maximum permissible value for <aWeight> as:
aWeight = Tmax / avgSmentTime
avgSmentTime() should be started from the Manager, and the value <aWeight> should be determined. The output is done with Debug() or by writing to a file.
Example
The performance of the user interface should be optimized, first determining the value of avgSmentTime(). In the GEDI, a panel is created that contains a simple text with the following parameters
main()
{
setValue("","text",avgSmentTime(1000));
}
Assume, for example, that the result displayed is 4E-5. If the maximum time prescribed for Tmax is 20 ms, then the ctrlMaxWeight is:
ctrlMaxWeight = 20E-3/4E-5
ctrlMaxWeight = 500
This is entered in section [ui] of the config file.