How-to
How to Display a Changing Image File in WinCC Flexible
Short answer
No ActiveX control is needed. A picture that never changes imports straight into the project; a disk file that changes every few minutes must be displayed by a runtime component that re-reads it — a browser-hosted view with atomic file replacement, a deliberate reload and a visible generation time, accepted only after the two-revision test passes on the runtime station.
On this page
- Do I need an ActiveX control to show an image in WinCC Flexible?
- Why doesn't the picture update when the file on the disk changes?
- How do I show a disk image that changes every few minutes?
- How do I replace the image file while the display is running?
- How do I stop the browser showing a cached copy of the image?
- How do I know the picture on screen is still current?
- What must pass before this goes on the production station?
- Questions asked
No, you do not need an ActiveX control to display an image in WinCC Flexible. A static picture in EMF, WMF, DIB, BMP up to 32-bit, GIF, JPEG, ICO or PNG imports into the project and renders in runtime with nothing added. A picture that changes every few minutes is a different requirement: the imported copy is frozen at transfer time, so the station needs a runtime display that re-reads the disk file at a fixed absolute path — a browser-hosted view, fed by rename-onto-name file replacement, refreshed on a deliberate cycle (30 s when the producer writes every 300 s) and stamped with a generation time. The decision rule is one line: static means import, changing means runtime display, and ActiveX enters only if a component provides something the built-in objects cannot.
Do I need an ActiveX control to show an image in WinCC Flexible? #
No — a static picture imports straight into the project, and WinCC Flexible graphic objects accept EMF, WMF, DIB, BMP up to 32-bit, GIF, JPEG, ICO and PNG without any third-party control.
Import the file through the project's graphics facility, place it with the image object, and transfer: the picture renders in runtime like any other screen element. That format list is the documented insert set for WinCC graphics, so a picture in any of those formats needs nothing beyond the engineering tool you already use.
ActiveX is a Windows mechanism for hosting software components inside an application. Hosting an external control adds a registration and dependency burden on the runtime station, and it is justified only when the component does something the built-in image object cannot. "Display a picture" is not such a case.
| The picture you have | The method that fits | What acceptance means |
|---|---|---|
| Never changes after commissioning | Import into the project | Renders in runtime after transfer |
| Changes only when engineering changes it | Re-import and transfer each revision | New revision visible after the transfer |
| Changes every few minutes while running | Browser-hosted runtime display | Two successive revisions appear without leaving the screen |
Why doesn't the picture update when the file on the disk changes? #
Because import bakes the picture into the project as a resource: the file is copied at build time, runtime renders the compiled copy, and nothing you do to the disk file reaches the screen until a new transfer.
That is the mechanism behind why an HMI edit needs a new runtime download — every revision of an imported graphic is a project edit, and the station shows nothing until that edit is transferred. A file that changes every few minutes would turn every image update into an engineering action, which is not a display method. The decision follows immediately: the changing picture must be read at runtime by a component that lives outside the compiled project.
How do I show a disk image that changes every few minutes? #
Host the picture outside the compiled project — a browser-style view on the runtime station pointed at the file — and prove on the actual computer that the reload works before you accept it.
This is a Windows-runtime-station technique, the environment covered in running a WinCC Flexible 2008 project in PC runtime, on a PC-based station such as a SIMATIC PC577. Which browser component that station offers, and whether it is permitted to read local files under the runtime account, is a property of the station — so both the selection and the test happen there, not on the engineering PC.
- Publish the image to one fixed absolute path that the Windows account running the runtime can read. Relative paths resolve against the working directory and break when startup differs.
- Open that path in the intended browser arrangement under the runtime account. The picture must appear with no access or security prompt.
- Host the view inside the HMI screen at the size operators need, covering no operator controls.
- Restart the runtime through its normal startup path. The picture must appear without anyone browsing to the folder or signing in.
Opening the file in a desktop browser proves the file is readable. It does not prove the hosted arrangement reloads — that is the subject of the next two sections.
How do I replace the image file while the display is running? #
Write each revision to a temporary name in the same folder and rename it onto the published name in one step, so a reader never sees a partially written file — and test the swap with the viewer open.
Overwriting the published file in place is the wrong pattern twice over: a reader can catch the file half-written, and a viewer holding the file open can block the overwrite. A rename within one folder is a single directory operation, and the published name always points at a complete file. The producer's write cycle becomes:
- Render the complete revision to a temporary name in the same folder — same folder keeps the rename on one volume.
- Rename the temporary file onto the published name as one operation.
- Never delete the published name first; the gap is an operator-visible missing file.
- Verify the rename succeeds while the viewer is open on the station. If an open handle changes the replacement behavior, that finding must surface now, not in production.
How do I stop the browser showing a cached copy of the image? #
Give the wrapper page a reload cycle and defeat caching at the same time: point it at the file through a request that changes with each revision, because a browser will otherwise keep serving the copy it already stored.
A browser that repaints its window, or that you navigate away from and back to, will happily repaint stored content — so none of that is an acceptance test. The reload has to be deliberate: a small wrapper page carrying the image, with a timed refresh that re-requests it, and with something revision-specific (the file's timestamp works) folded into the request so the stored copy cannot satisfy it. How a given browser treats that on local files differs by browser and version, which is exactly why the two-revision test runs on the station.
Set the reload interval from the staleness you can accept, using worst-case displayed age = write cycle + reload interval. Worked example: the producer writes every 300 s. With a 60 s reload, the worst case is 300 s + 60 s = 360 s, so an operator can be looking at a picture up to 6 minutes old. If the station's limit is 6 minutes, 60 s passes with zero margin; 30 s gives 300 s + 30 s = 330 s. Below that the gains shrink to nothing, because the 300 s write cycle dominates and a reload between writes only fetches the same revision. Decision for this station: 30 s.
How do I know the picture on screen is still current? #
Bake a generation time into the picture itself and treat anything older than two producer cycles as stale: at a 300-second write cycle, a picture whose timestamp is more than 600 seconds old means the updates have stopped.
Rendering and freshness are separate conditions — a plausible-looking picture can be hours old. The producer should stamp each revision with its generation time where operators can read it, and the two-cycle threshold turns "is this live?" into a glance. Test the failure modes before deployment: a missing file, a denied access, a stopped producer. A broken-image indicator in the wrapper page is an acceptable fault state; a silently aging picture is not. If anyone uses this picture to judge a machine state, treat an expired frame as no picture at all and decide on the instruments.
What must pass before this goes on the production station? #
Four checks: the image loads through the normal startup path under the runtime account, two successive revisions appear without leaving the screen, no partial picture appears during swaps, a dead producer becomes visibly stale within two cycles, and clicking the hosted view never captures focus from the operator controls.
- Cold start through the normal startup path: the picture appears from the fixed absolute path, under the runtime account, with no prompt and no manual browsing.
- Update proof: publish two hand-made, visibly different revisions — large revision numbers in the picture make the difference unmistakable — and watch the second replace the first inside the reload window computed above.
- Swap integrity: run the real producer alongside the HMI through several cycles; no partial picture, no file-access message, no failed rename.
- Staleness proof: stop the producer and confirm the visible generation time crosses the two-cycle threshold and the fault state takes over.
- Focus behavior: clicking the hosted view must not capture keyboard focus or navigate anywhere that obstructs normal HMI operation.
Questions asked
Which image formats can WinCC Flexible import without an ActiveX control?
The documented insert formats for WinCC graphics are EMF, WMF, DIB, BMP up to 32-bit, GIF, JPEG, ICO and PNG. Keep every revision of a changing picture in the same format, because a viewer that has to renegotiate a different decoder mid-run is one more failure mode you do not need.
How old can the displayed image get in the worst case?
The worst-case age is the producer's write cycle plus the reload interval. With a 300-second write cycle and a 60-second reload that is 360 seconds; dropping the reload to 30 seconds buys only 30 more seconds, because the write cycle dominates. Reloading faster than the producer writes just re-fetches the same revision.
What should happen when the image file is missing or unreadable?
The screen must show a visible fault state, never a silently stale picture. A broken-image indicator in the wrapper page is acceptable; an old frame that keeps looking current is not. On the writing side, never delete the published file before renaming the new one into place — the delete-then-write gap is exactly the missing-file window operators would see.
Does the browser approach work on every WinCC Flexible target?
No. It depends on a Windows-based runtime station with the browser hosting you selected actually present and permitted to read local files; an embedded panel target offers a different option set. Whichever station runs the project is where the reload test has to pass, not the engineering PC.