How can the performance be improved with tag-triggered scripts?
All optimization measures, caches etc. of WinCC are canceled if, in a project with tag-triggered C scripts, other tags are requested that generate tag names via string functions or are called in a C script via the GetTag... function. Each of these tags is then read separately synchronously.
You can significantly reduce the picture-build time by reading the tags in a task (block) after the picture opens. The scripts can then access the tags in the cache and do not have to be read separately (synchronously) first. In this way the communications between the individual tasks and the necessary task change are greatly reduced. When accessing tags that have not been put in the trigger list, these tags are not requested "as block" upon picture selection for the first update (therefore always for time-triggered scripts).
If reconfiguring is too complicated, a dummy object can be created in the picture with a trigger list of all the tags used in the picture (Figure 1).
trigger_e.gif ( 33 KB )
Figure 1: Trigger list in WinCC
Whether the tag names are generated dynamically in the script is of no importance here. When the script is processed, these tags have to be read synchronously, because at the start of the script they are not yet available on the client (and data manager). The following brief example makes this clear:
The trigger list contains the following, for example:
and in the script of your object in the WinCC Graphics Designer access is made to Variable_B:
long _main(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
long color = -1;
color = GetTagWord ("Variable_B");
- In this example, "Variable_B" is read synchronously upon picture selection => bad performance.
- The following line in the script would improve the performance:
color = GetTagWord ("Variable_A");
Performance improvement, Access time, Access