IMDTouchKnowledge BaseShop main store

How-to

How to Animate a Tank Level Graphic on an HMI Screen

HMI and touchscreens Published 6 min read

Short answer

Fill a vector tank symbol through the symbol component's fill option, bound to the scaled level channel with the empty and full endpoints matched. Normalize any level with f = (L - L_empty)/(L_full - L_empty), where all three values share units. A linear gauge suits only a narrow column, and the size parameter demands channel inversion.

On this page
  1. Pick the method before you draw anything
  2. Build the tank from a vector symbol
  3. Bind the fill to the level channel
  4. Normalize the level with one formula
  5. When the gauge or the size parameter wins
  6. Test the animation before you call it done
  7. Questions asked

The liquid in a tank graphic rises and falls with one mechanism: the fill option of a symbol component, applied to a vector cutaway tank or a plain rectangle, with its fill value bound to the scaled level channel. Match the animation's empty and full endpoints to the instrument range and normalize with f = (L - L_empty)/(L_full - L_empty), where all three values use the same engineering units. On a tank ranged 0 to 2500 mm, a measured 1500 mm gives f = (1500 mm - 0 mm)/(2500 mm - 0 mm) = 0.60, so the liquid stands at 60% of the column and the loop carries 4 mA + 16 mA × 0.60 = 13.6 mA. A linear gauge suits only a narrow column, and the size parameter needs channel inversion because sizing is referenced to the top. Layout and color follow the rules of designing HMI screens for clear operator decisions; this page builds the mechanism that moves the liquid.

Pick the method before you draw anything #

Four techniques move a liquid level, and each has a hard limit that decides the choice before any drawing starts.

Method How it moves the liquid Hard limit Commit to it when
Fill option on a symbol component A vector symbol fills upward as the value rises Vector graphics only; a bitmap will not fill The liquid belongs inside a tank outline — the default
Linear gauge overlaid on the tank A bar grows behind the artwork; ticks and labels hidden The gauge cannot be made wide A narrow level column is enough
Size parameter on a symbol The symbol is resized from a scaled value Sizing is based on the top, so invert the channel and scale to pixels by hand The shape itself must change
Multi-state bitmap Picture frames swap at set values Motion steps, and every frame is drawn by hand A coarse indication at a few levels

Commit to the fill option for an ordinary tank: it animates the artwork itself, needs no pixel arithmetic, and follows the value up and down. The other three earn their place only where the fill cannot go.

Build the tank from a vector symbol #

Take a cutaway tank from the symbol library when the liquid should show inside the tank outline; a plain vector rectangle is enough when a column beside the process is all the operator needs. Set the liquid color before any binding, so the empty state is visible from the first test.

The fill option works on vector graphics only. A GIF or JPEG tank will not fill, whatever it is bound to. If the artwork you want is a bitmap, keep it as the static container, add a separate vector liquid area inside it, and check the drawing order so the container does not sit in front of the liquid — the same layering fault you fix when overlapping graphics hide HMI symbols.

Bind the fill to the level channel #

  1. Place the cutaway tank symbol or vector rectangle and set the liquid fill color.
  2. Enable the fill option on the symbol component.
  3. Bind the fill value to the same channel or tag that carries the scaled level — the one a numeric display on that channel would show.
  4. Set the animation's input range: if the editor accepts engineering units, enter the empty and full endpoints directly; if it accepts a fraction or percent, enter 0 to 1 or 0 to 100 and drive it with f. Read the accepted range from the component help rather than guessing.
  5. Check direction: a rising value fills upward from the bottom, a falling value drains.

Bind to the scaled engineering-unit tag rather than the raw input register whenever the controller offers both. The endpoints then match the instrument data sheet, and the fill inherits the controller's scaling with one subtraction instead of a second one on the screen.

Normalize the level with one formula #

f = (L - L_empty)/(L_full - L_empty)

All three values must use the same units, and L_full must differ from L_empty, or the divide is by zero. Matched endpoints make f run 0 at empty and 1 at full, and the fill follows it linearly.

Worked example: a 0 to 2500 mm tank #

A level transmitter ranged 0 to 2500 mm feeds a tag scaled into millimeters, so L_empty = 0 mm and L_full = 2500 mm. At a measured L = 1500 mm:

f = (1500 mm - 0 mm) / (2500 mm - 0 mm) = 1500 / 2500 = 0.60

A percent fill input takes 0.60 × 100 = 60, so the liquid stands at 60% of the column height. The 4-20 mA loop cross-checks: that level carries 4 mA + 16 mA × 0.60 = 13.6 mA, and (13.6 mA - 4 mA) / 16 mA = 0.60. The same fraction at the wire, in the controller and on the screen; if they disagree, the scaling chain is at fault, not the animation — that chain is what scaling a PLC integer into an HMI display value walks through.

Decision: when the fill input accepts engineering units, enter 0 and 2500 and send the tag as-is. Normalize to f only when the input is fixed at a fraction or percent.

When the gauge or the size parameter wins #

The linear gauge is the fastest build for a narrow column: drop it over the tank artwork, hide the ticks and labels, and bind the same channel. It cannot be made wide, so that is its whole territory — a slim level strip, nothing the operator should read as a volume.

The size parameter is the only method that changes the shape rather than filling it, and it pays for that with arithmetic. Sizing is based on the top of the symbol, so the channel must be inverted, and the level must be mapped to pixels by hand. With the worked example's liquid area 320 px tall, the height at f = 0.60 is 0.60 × 320 px = 192 px, sent inverted so the liquid grows from the bottom instead of hanging from the top. For an ordinary cutaway tank that is pure overhead — the fill option does the same job with none of it.

Test the animation before you call it done #

Drive values from the editing software's test mode or a forced controller value — the procedure in testing HMI simulation against a live PLC — so the whole chain is proven without touching the process:

  1. Put a temporary numeric display on the same channel, beside the tank. It shows whether the HMI receives a changing value independent of the graphic.
  2. Force the empty value and check the liquid's empty appearance.
  3. Force an intermediate value and compare the visible fill with the computed fraction — 60% at 1500 mm here.
  4. Force the full value and check the liquid stays inside the outline.
  5. Step the value back down and watch the liquid fall; a stuck liquid with a moving number points at the binding, not the artwork.

The split is mechanical: a frozen number means acquisition — the address, the driver, the controller update — while a moving number with a static liquid means the animation binding or its range. Fix the half that failed and retest from empty.

One limit to respect: the animated tank is indication only. A bounded fill clamps at both ends, so an overfull tank looks exactly like a full one — keep a numeric readout or status indicator beside the tank for abnormal values, and leave the limits to the controller's alarms and interlocks.

Questions asked

Why does the tank show full when the level is only half?

The fill input range and the tag range disagree. If the animation expects 0 to 100 and receives engineering units such as 1500, the value reads far past full and clamps there. Check in the component help whether the fill input takes 0 to 1 or 0 to 100, then convert: f = 0.60 sends 60 to a percent input, or 0.60 to a fractional one. Match the endpoints in one place and the graphic tracks.

Can the fill option animate a JPEG or GIF tank picture?

No. The fill option animates vector graphics, so a GIF or JPEG tank will not fill however it is bound. Use the bitmap as static container artwork, layer a separate vector liquid area inside it, and check the drawing order so the container does not cover the liquid. A multi-state bitmap can swap hand-drawn frames instead, but the level steps between pictures rather than flowing.

The liquid sticks at its last position. Is that the graphic or the data?

Mostly the data. Put a numeric display on the same channel: if the number is frozen too, the fault is acquisition — the address, the driver or the controller update — and the animation never sees a change. If the number moves while the liquid does not, the binding or the input range on the fill is wrong. One display splits the problem in half before you touch the artwork.

How do I show an overfull or faulted transmitter on this graphic?

Not with the fill alone. A bounded fill clamps at empty and full, so a faulted reading below empty looks identical to a genuinely empty tank. Keep a numeric readout or a status indicator next to the tank for abnormal values and raise the alarm in the controller; the graphic confirms conditions, it does not protect the machine.

Keep reading

  • Troubleshooting

    HMI Text Runs Off the Screen After Downloading the Project

    The panel and the project are both fine: the engineering PC's Windows display scaling is above 100%, so the downloaded layout lands past the panel edge even though the editor and offline simulation look correct. Set the scale to 100%, restart the PC, then redownload.

    HMI and touchscreens

  • Explainer

    Designing HMI Screens for Clear Operator Decisions

    High performance HMI design under ANSI/ISA-101.01-2015 makes abnormal conditions easier to spot than normal operation: normal running renders flat and gray, saturated color appears only on deviations, and every icon, font and color follows one documented project style. Verify the style mechanism on a single screen before scaling to the full library.

    HMI and touchscreens

  • Troubleshooting

    HMI boots to black screen instead of browser favorite

    Boot-to-black on a browser-based HMI is a startup-priority conflict, not a display fault. Confirm the Browser Favorite opens the PLC page manually, enable its Startpage flag, then check whether a local application calling an empty TargetVisu is taking the foreground at boot on a Visu or Control Panel. Match firmware to the exact order number before any reset.

    HMI and touchscreens