Back

Topic

[KB207]Optimizing CPU performance when loading animated GIF images

Tags: Animations

14 years ago
By RM
Options
Print
Applies to:

PcVue version 7.20a onwards.


Summary:

This article explains how optimise CPU performance when loading Animated GIF images into a mimic.


Details:

If a GIF animation is heavily used in a mimic (e.g. played in a loop) the PC’s CPU loading increases considerably and slows down navigation in the HMI.  If the GIF images are deformed, that increases the CPU loading further. In an extreme case, a call to open a pop-up windows will not work. In such cases, the pop-up windows may be open behind the main window instead of being open in the foreground.

The reason is as follows. The graphic interface (the HMI that manages the user interface) is overloaded with refresh requests (Window ‘repaint’).  The CPU utilisation rate is then close to 100% because of the frequency of refreshing the GIF Animation. This is set by default to 10 milliseconds and is not adjustable in its Properties dialog.

The means of avoiding this problem are to modify the playback speed of the GIF and to control its running and stopping by linking it to a variable:

Modify the playback rate

  1. Right-click on the image to open the Image Properties dialog. Select the Settings tab.
  2. In the Frame Delay section,change the setting from Automatic to Manual.
  3. In the box that then appears, set the delay to a longer interval of at least 200ms. This should eliminate the problem.

Animated_GIF_image_frame_delay_dialog

 

The animated GIF will flip one frame every n milliseconds.

Link the playback condition to a variable

  1. Create a bit variable to control the running of the animation (e.g. to be turned On/Off by a button in the mimic).
  2. Select the Animated GIF image in the mimic, then select Display.Properties List.
  3. In the Variable Links section, select PlayCondition.
  4. Use the drop-down arrow beside it to list the variables. Select the one that you created.

Animated_GIF_linked_to_a_variable

  1. Close the Properties dialog.

The animated GIF will only run when the variable has a non-zero value.

Both (recommended)

  • Set the playback rate and control the playback, as described above.

Further information

For advice on using GIF animations, see the PcVue Help topic ‘Developing the HMI.Drawing.Inserting images.Animated GIF and AVI Files’.


Created on: 05 Nov 2010 Last update: 13 May 2024