WinCC SCADA · Lab Manual

WinCC SCADA Trends: Tag Logging Archives and OnlineTrendControl Lab Manual (V8.1)

An archive is only as useful as what it kept. This lab manual builds WinCC Explorer V8.1 trends through all six stages – a flow transmitter, scaling, PLC helpers in ladder and SCL for enable and min/max/average, Tag Logging cycles and compression, and the OnlineTrendControl – then lets you trade detail against archive size live.

2,500+ engineers trained 4.9/5 Google rating 21+ years, Chinchwad, Pune Next batch: contact for dates
Quick answer

Scale the value in the PLC, add helpers in ladder or SCL (an archive enable and minute min/max/average), load the tags into WinCC, create a process value archive in Tag Logging with sensible acquisition and archiving cycles or archiving on change with hysteresis, plan segment size and backup, and display it with the OnlineTrendControl and OnlineTableControl.

  • Acquisition reads, archiving stores – size both deliberately.
  • Compress steady values with archiving on change.
  • Let the PLC capture peaks inside each archive interval.

How Tag Logging Is Structured

Tag Logging reads tags at an acquisition cycle, writes values into a process value archive at an archiving cycle (optionally mean, min or max of the interval, or on change), and stores them in time segments that can be backed up. Controls in Graphics Designer then read live and historical values from the archive.

Lab Flow: From Flow Transmitter to WinCC Trend

Every lesson in the Softwell PLC lab manual series follows the same six stages and the same address rule, so the code you write here plugs straight into the HMI lessons.

Lab manual flow: field input to tested HMI screenSix stages: field device and PLC tag, input mapping to DB_IO, PLC logic, HMI tags, graphics linking, and perform and test.1Field + tags%IW110 %I8.6flow, running2Input mappingSCALE_X→ DB_IO3LogicArchive helpersLAD + SCL4WinCC tagsS7-1500 channelReal values5Tag Loggingarchives, trendcycles, segments6Perform + testSimulatordetail vs sizeAddress rule for every lesson: %I only in FC_InputMapping, %Q only in FC_OutputMapping, symbolic DB members everywhere else – including the HMI.
Figure 1 – Six-stage lab flow for this lesson.

Stage 1Field Wiring and PLC Tags

PLC tagAddressTypeDevice / comment
FT501_Raw%IW110IntFlow 4–20 mA = 0 – 20 m³/h
M501_Running%I8.6BoolLine running feedback

Stage 2Input Mapping and Scaling

// FC_InputMapping
"DB_IO".FT501_Valid := "FT501_Raw" <= 32511;
"DB_IO".FT501_m3h   := SCALE_X(MIN := 0.0, MAX := 20.0, VALUE := NORM_X(MIN := 0, VALUE := "FT501_Raw", MAX := 27648));
"DB_IO".M501_Running := "M501_Running";

Stage 3PLC Logic in Ladder and SCL

Archive helper networks for flow FT501Ladder diagram: Network 1 — Line running: archive only while producing (archiving start/stop tag); Network 2 — Batch end pulse for an event-driven archive recordNetwork 1 — Line running: archive only while producing (archiving start/stop tag)M501_Running"DB_IO"FT501_Valid"DB_IO"ArchiveEnable"DB_Arch"Network 2 — Batch end pulse for an event-driven archive recordBatchDone"DB_Batch"BatchEndPulse"DB_Arch" (P-trig)
Figure 2 – Archive enable and batch-end pulse in ladder.

The same logic in SCL – use whichever your plant standard prefers; both write the same DB members that WinCC reads:

// FB_ArchiveHelper in OB30 (1 s) – min/max/avg over each minute for a compressed archive
// STAT: n : Int; sum, mn, mx : Real;  DB_Arch: Avg1m, Min1m, Max1m : Real; ArchiveEnable : Bool;
"DB_Arch".ArchiveEnable := "DB_IO".M501_Running AND "DB_IO".FT501_Valid;    // ladder network 1
IF #n = 0 THEN #mn := "DB_IO".FT501_m3h; #mx := "DB_IO".FT501_m3h; #sum := 0.0; END_IF;
#sum := #sum + "DB_IO".FT501_m3h;
#mn  := MIN(IN1 := #mn, IN2 := "DB_IO".FT501_m3h);
#mx  := MAX(IN1 := #mx, IN2 := "DB_IO".FT501_m3h);
#n   := #n + 1;
IF #n >= 60 THEN                                            // every minute
    "DB_Arch".Avg1m := #sum / 60.0;  "DB_Arch".Min1m := #mn;  "DB_Arch".Max1m := #mx;
    #n := 0;
END_IF;

Stage 4Link PLC Tags to WinCC

In Tag Management add the SIMATIC S7-1200, S7-1500 Channel, create a connection with the CPU IP address, then use AS Symbols to load the PLC symbols and drag the DB members you need into a tag group. The DB members must have Accessible from HMI ticked in TIA Portal. Names and menus can differ slightly between WinCC versions.

WinCC tagData typeConnection / addressUsed by
DB_IO_FT501_m3hFloating-point 32-bitsymbolicArchive PVA_Flow, trend
DB_Arch_Avg1m / Min1m / Max1mFloating-point 32-bitsymbolicCompressed archive
DB_Arch_ArchiveEnableBinarysymbolicStart/stop archiving

Stage 5Configure Tag Logging and Link the Trend Controls

ItemSetting
Timers1 s acquisition, 5 s or 60 s archiving as needed
Process value archive PVA_FlowFT501_m3h: acquisition 1 s, archiving 5 s, mean value; or on change with hysteresis 0.5 m³/h
Minute archiveAvg1m, Min1m, Max1m archived every 60 s
Archive configurationSegment size and period, backup path for swapped-out segments
Trends.pdlWinCC OnlineTrendControl with FT501 and the minute values; OnlineTableControl for exact values; time axis 1 h

The panel version with data logs is in HMI trends and data logs.

Stage 6Perform and Test: Acquisition, Archiving and Compression

The grey line is the real flow; the dark line and dots are what the process value archive keeps. Change the acquisition and archiving cycles or switch to archiving on change, and watch the trade-off between detail and archive size.

Flow and PLC
WinCC Runtime · OnlineTrendControl
Trends.pdlArchive PVA_Flow
Records (10 min)per day≈

Troubleshooting

SymptomLikely causeFirst check
Peaks missing in the trendArchiving cycle too long, value averagedUse PLC min/max or shorter cycle
Archive fills the diskToo many tags at short cyclesArchive on change, longer cycles, segments
Trend flat after restartOnline-only curve or archive not runningCurve source, archive state
Old data missingSegments swapped outReconnect backed-up segments

Hands-On Lab: Build a WinCC Archive and Trend Screen

Hands-on
Before you start
  • TIA Portal and WinCC Explorer V8.1
  • Estimated time: 75 minutes
1

Wire and declare FT501

Declare FT501_Raw and M501_Running.

Signals declared.
2

Scale into DB_IO

Scale FT501 to m³/h and set FT501_Valid.

FT501 reads in m³/h.
3

Write the archive helpers in ladder and SCL

ArchiveEnable in ladder; minute min/max/average in SCL in OB30.

ArchiveEnable and minute values update.
4

Load the tags into WinCC

Load DB_IO.FT501_m3h and DB_Arch members.

Tags appear in WinCC.
5

Configure Tag Logging and the trend

Process value archive with cycles, compression and segments; OnlineTrendControl and table on Trends.pdl.

Trend shows live and historical data.
6

Test and size

Compare cyclic and on-change archiving and calculate the yearly size.

You can state archive size per year for your settings.
Checkpoint—how to know you did it right

The archive keeps the detail you need at a size you planned, peaks survive compression, and the trend shows both live and historical values.

Frequently asked questions

What is the difference between acquisition cycle and archiving cycle?

The acquisition cycle is how often WinCC reads the value; the archiving cycle is how often a value is written to the archive. Archiving is a multiple of acquisition and can use mean, minimum or maximum over the interval.

When should I archive on change instead of cyclically?

For values that are steady for long periods, such as levels or setpoints. With a hysteresis, only meaningful changes are stored, which keeps the archive small without losing events.

How do I keep years of data?

Use segmented archives with a defined segment size and period, swap them out (back up) to a long-term location, and reconnect them when you need to analyse old data.

Why calculate min, max and average in the PLC?

So a one-minute archive record still shows the peaks that happened inside the minute. The PLC sees every scan; WinCC only sees its acquisition cycle.

Which control shows archived values?

The WinCC OnlineTrendControl for curves and the OnlineTableControl for values; both can read process value archives and show live and historical data.

Should the PLC logic be ladder or SCL here?

The enable condition is simple and readable in ladder; the min/max/average over 60 samples is cleaner in SCL. Both are shown.

Reviewed by Bhawesh Kumar SinghIndustrial Automation Trainer and Industry 4.0 Consultant · Softwell Automation · 21+ years industry experience

Get the full syllabus + free demo class

Share your details—a Softwell training advisor will contact you with batch dates, fees and hardware-practice options.

No spam. Used only to share course details for this enquiry.

Learn with practical industrial examples

Join live online, Pune classroom or corporate in-plant automation training.

Request Course Details
Verified learning pathway

Discuss WinCC SCADA Trends and Tag Logging

Explore practical curriculum, software, hardware and batch options for this technology.

Content reviewed: 16 October 2026

Siemens PLC & TIA Portal Learning Path

Continue with the related Siemens PLC tutorials in this practical learning series.

  1. SCL vs Ladder Logic
  2. Upload PLC Program
  3. TIA Selection Tool
  4. Analog Input Scaling
  5. PLC Counters
  6. PLC Timers
  7. Addressing & Data Types
  8. Hardware & PLC Tags
  9. OB, FB, FC & DB
☎ Call WhatsApp ✉ Email Enquire Now