Applies To:
  • CitectSCADA 4.00 4.10

With the release of Version 4 the animation system was re-written to provide flicker free animation. For animations hard coded by Citect the graphics performance is high providing good speed and efficiency. However when users try to provide animation through cicode and or advanced animations performance is penalised due to unnecessary redrawing of the screen. Two INI options and two cicode functions have been added to alleviate these problems.  

In version 4 any cicode embedded in advanced animations that place, move or modify animations will result in a repaint occurring on every execution of a cicode function that modifies animations. This results in significant overhead if your cicode needs to modify many animations. The new [Page] parameter DelayRenderAdvancedAnimation will delay the rendering of animations until after the Advanced animation cicode has run. This results in the screen only being repainted once per animation cycle rather than once per animation related cicode function call. This parameter defaults to TRUE (enabled).

As an extension to this we have also added a parameter which delays the rendering of all animations so that all animations (advanced animation, animated symbols, size move, strings tags etc) are updated synchronously every animation cycle. The new [Page] parameter DelayRenderAll does exactly this. By default this parameter is FALSE (disabled). Depending on the complexity and layout of a page it may or may not be beneficial enabling delayed rendering. For some pages speed may be improved and for others it may not. Another aspect of this mode that users may find disturbing is that there may be a significant delay before a change is seen in the display of the page. It may for instance take half a second to draw all the animations on a page for the first time so the user will experience this as half a second of apparent complete inactivity. With delayed rendering off the user actually sees the objects being drawn one by one giving greater visual feedback to the operator.

As with advanced animation cicode, library defined cicode will suffer the same speed problem when implementing animations through cicode. To allow cicode the scope of improving the animation speed two new cicode functions have been added: DspDelayRenderBegin and DspDelayRenderEnd. The concept behind using these functions is simple. Whenever you wish to perform some cicode which will modify the appearance of a page call DspDelayRenderBegin, then the cicode that modifies the animations and then DspDelayRenderEnd. Once DspDelayRenderBegin is called all screen updating ceases until a corresponding call to DspDelayRenderEnd.

A few general rules to using these functions need to be stated. When writing animation related cicode try to keep all the animation code in one function and sandwiched between one DspDelayRenderBegin/End pair. Try to make this cicode as efficient as possible and do not call Sleep or any other cicode functions which will take a long time to run. If you do you will find that your display will temporarily freeze for the duration it takes the cicode between DspDelayRenderBegin and DspDelayRenderEnd to execute. Make sure that you always call these functions in pairs. The cicode engine has been modified to take care of this for you if you happen to forget but you should still do it to obtain the best possible performance. You can call DspDelayRenderBegin as many times in a row as you like so long as you call DspDelayRenderEnd the same number of times. The very first call to DspDelayRenderBegin will freeze the display. Under no circumstances should you change the active window using the WinSelect cicode function in between calls to DspDelayRenderBegin and DspDelayRenderEnd. If you do you may find that you page freezes for good. Finally do not attempt to call DspDelayRenderBegin from the Kernel directly or your page will permanently freeze. It can be called indirectly via user cicode though. This problem will be fixed in a future release of Citect. The syntax for these cicode functions is as follows:



Both functions take no parameters and return no values.