Selection guide
Historian alternative for PLC batch tracking records
Short answer
Simple batch tracking needs one row per completed batch, not a tag historian. Size the choice with batches per day, retention and concurrent viewers: memory-card logging covers CSV-only jobs, a PC acquisition package adds web viewing and export with no report code, and a companion PC writing to SQL Server Express hands reporting to a database owner — the storage math is megabytes either way.
On this page
- Do you need a historian for simple PLC batch tracking?
- What must the record freeze when a batch completes?
- Will the controller's SD card alone meet the Excel and web output?
- When is a PC-based acquisition package the right choice?
- How much database room do batch records actually need?
- Which option fits which plant?
- What do you test before sign-off?
- Questions asked
For one record per completed batch — the batch number, the amount requested, the amount transferred, the start time and the completion time — you do not need a tag historian. You need three functions most controllers and PCs already supply: capture the record at completion, store it, and present it as a spreadsheet and a web page. This article sizes the three practical paths — the controller's memory-card logging, a PC-based acquisition package with its own viewer, and a companion PC writing one row per batch into SQL Server Express — against three inputs: batches per day, retention and concurrent viewers.
Do you need a historian for simple PLC batch tracking? #
No — one five-field row per completed batch is about 5.5 MB of records per year at 150 batches a day, and a historian's compression engine, tag store and replay tools exist for dense tag samples this job never produces.
The arithmetic: 150 × 365 = 54,750 records in a year; budgeted at about 100 bytes per record — five fields plus row overhead and the index you will want for lookups by batch number — that comes to 5,475,000 bytes, roughly 5.5 MB. A historian earns its keep compressing thousands of tag samples per second into a store that still replays fast; a batch line hands it tens of rows per day, so every historian feature you configure is a feature the record never exercises. Treat this as a small logging application with a spreadsheet and a web output, and three paths cover it.
What must the record freeze when a batch completes? #
Freeze all five fields into one pending record at the completion event — before any totalizer resets or the next batch overwrites the working values — and give that record a unique execution identity so a completion bit that stays on for several scans cannot insert duplicate rows.
Split the job into capture, store and present, and keep the boundaries strict. At batch start, latch the batch number, the requested amount and the start timestamp into a working record. At the completion event, latch the transferred amount and the completion timestamp, then move the finished record into a pending queue. Nothing in the PLC edits a pending record afterwards.
Release a record only when the storage path confirms the write; until that acknowledgment it is pending, not stored — the same completion question the article on when store-and-forward data counts as stored in the historian answers for buffered historian data. Size the pending queue for the longest storage outage you intend to ride out, the same discipline as choosing an edge data path for periodic records.
Keep storage failures visible as their own condition. The pump finished and only the report is missing; never let an operator re-run a physical transfer to repair a row, and never wire an interlock or a completion signal to the reporting path.
Decide aborted and interrupted batches before go-live: either they log with an aborted flag or they are excluded, but write the rule down, because the first operator who aborts at 95 percent will ask where the row went.
Will the controller's SD card alone meet the Excel and web output? #
Capacity never decides it — ten years of records at the example rate is about 55 MB, small against any card — the deciding fact is output: a card logger writes CSV files for Excel but serves no web page, so it fits only when file retrieval replaces the browser.
The arithmetic agrees: 150 × 365 × 10 = 547,500 records, and 547,500 × about 100 bytes = 54,750,000 bytes, about 55 MB — and card wear is a non-issue at this rate, because an event-based logger appends once per batch instead of every scan.
The function is documented across controller families: CLICK PLCs with a microSD Card slot log PLC addresses through their Data Logging Setup; BRX Do-More writes a timestamped CSV to the micro SD card or RAM from a single instruction, time-based or event-based; the S7-1500's Data Logging writes CSV to the SIMATIC Memory Card. Use the event-based trigger so exactly one record lands per completion pulse, and read your controller's own data-logging documentation for the limits that vary by model — maximum file count, maximum file size, card format and the retrieval path, whether that is pulling the card or FTP.
Commit: take the card when the audience is a technician who opens a weekly CSV in Excel; the moment anyone expects to type a browser address, the card is the wrong answer and one of the two PC paths below supplies the web half.
When is a PC-based acquisition package the right choice? #
Take a PC-based acquisition package when the browser view and Excel export must work without anyone writing report code: it supplies acquisition, historical storage, a trend and report viewer, export and a web client, and your work reduces to configuring the controller driver and the batch-completion trigger.
Verify four things in the vendor's documentation for the exact package version before committing:
- a supported communication path to your controller;
- export from stored history to CSV or Excel, not only live values;
- a web client that serves stored records from the client machines on your network;
- a runtime license for continuous deployment on the PC that runs it — a development or demonstration seat licenses design work, not the machine on the plant floor.
Count viewers across shifts and read the package's documented concurrent-client limit for the edition you select; two curious users and thirty people opening the same report at shift change are different editions. This is the right option when the browser and the export must work on day one and nobody on site writes report code.
How much database room do batch records actually need? #
Storage never binds: five years at the example rate is about 27 MB of rows against the Express edition's documented 10 GB per-database limit, so the companion-PC option is chosen for its reporting path, not for capacity.
Work the example end to end. Budget each record at about 100 bytes — the batch number as 8 characters, two 32-bit amounts at 4 bytes each and two 8-byte timestamps are 32 bytes of data, and the rest covers row overhead plus the index that makes lookups by batch number fast. Five years at the example rate is 150 × 365 × 5 = 273,750 records, which at that budget comes to 27,375,000 bytes, about 27 MB. Microsoft documents a 10 GB per-database limit for SQL Server Express, log files excluded; that same limit holds roughly 100 million records, so capacity never decides this option.
SQL Server Express omits SQL Server Agent, so the nightly export or cleanup job runs under Windows Task Scheduler instead, and the instance needs the same discipline as any production database: scheduled backups, watched disk headroom, a tested restore.
The database stores rows; it does not present them. The spreadsheet and the web page are deliverables someone builds on those rows — queries, a report template, a small web page or a BI view. Choose this path when that person exists and the records must join other plant data; choose one of the other two paths when that person does not.
The write side is a small collector on that PC reading the controller, with the completion trigger inserting one row per batch — the same mechanics as logging PLC values from an OPC server into SQL Server.
Give the database a proper home: a fanless industrial mini PC mounted in the panel or cabinet rather than an office desktop under a bench.
Which option fits which plant? #
Choose by output and ownership, not capacity: the card wins when a CSV is enough, the acquisition package wins when a browser must work with no report developer, and the companion PC with SQL Server Express wins when a database person owns reporting.
| Decision input | Memory-card logging | PC acquisition package | Companion PC and SQL Server Express |
|---|---|---|---|
| Excel output | CSV opened directly | Built-in export from stored history | Rows queried into a report you build |
| Web page | None | Built-in web client | Built by the report owner |
| Code to write | Logging logic only | Configuration only | Queries, report and web page |
| Owner after go-live | PLC technician | Controls or instrumentation technician | Database person |
| Fails when | Someone wants a browser URL | Viewer count outruns the edition's client limit | No one owns the queries |
Commit by case. A CSV that a technician opens weekly is the card, with the event-based trigger and a scheduled file pull. A browser that must work on day one with no report developer is the acquisition package, with the runtime license on the PC that runs it. A browser, an export and records that must join other plant data is the companion PC with SQL Server Express, and the database owner is assigned before the hardware is ordered.
Batch count alone never flips the decision to a historian: at 2,000 batches a day over ten years, 2,000 × 365 × 10 = 7,300,000 records, about 730 MB at the per-record budget, which every option absorbs. A historian enters the picture only when the requirement grows into dense process trends across lines, and choosing a site historian for a PC-based SCADA host is where that conversation starts.
What do you test before sign-off? #
Test the whole path before sign-off — capture, storage, export, web view, outage recovery and restart — and write down the expected and the observed result for every step, because a system that stores rows but cannot reproduce them is not finished.
- Run one controlled batch with a recognizable number and a requested quantity you chose; compare all five stored fields against the controller's latched values, field by field.
- Complete several batches in succession; each execution produces exactly one record with no values from its neighbour.
- Open the export in Excel and check column separation, decimal separators, timestamp reading and a batch number with leading zeros.
- Open the web view from the machines that will actually use it, and exercise its filters and its export against the same stored records.
- Take the storage destination offline under controlled conditions; confirm records hold pending, flush exactly once on recovery, and no duplicates appear.
- Restart the controller and the storage host with the queue non-empty; confirm what survives and what resumes.
- Read back the clock source and time zone on both sides, because out-of-order records are almost always a clock mismatch, not a logging fault.
Questions asked
Can a PLC write batch records straight into SQL Server?
Some controller families ship a database instruction or driver that inserts rows directly; where yours does not, a small PC-side collector that reads the controller over OPC or pulls the CSV files does the insert instead. Confirm the exact instruction, driver and versions in the controller documentation before promising a direct write, and run one completed batch end to end before trusting the path in production.
When would SQL Server Express's database limit ever matter here?
Almost never. Microsoft documents 10 GB per database for the Express edition, log files excluded, and at about 100 bytes per record that is roughly 100 million rows — decades of running even at a few hundred batches a day. Treat the limit as never binding for batch records; watch disk headroom, backups and a tested restore instead.
What makes a real Excel workbook different from a CSV export?
Excel opens a CSV directly, so a flat list of batch rows needs no extra work. A formatted workbook with company headers, formulas, charts or several sheets is a reporting feature: generate it from the stored rows with a query-driven template or a BI tool, and test it as a separate deliverable rather than as part of the logging step.
How big should the pending-record queue be?
Size it for the longest storage outage you intend to survive. At the example rate a two-day outage is about 300 records, roughly 30 KB, so queue memory is rarely the constraint; the real risk is an unplanned outage nobody is watching. Release queued rows only after the destination confirms the write, and keep the backlog count visible to operators.
Does a batch record need historian compression or deadband?
No. Compression and deadband exist to shrink dense tag samples; a batch record is one row per completed event and every field matters, so store the rows at full resolution. If batch rows start duplicating, suspect the completion logic — a bit that stays on across many scans, or a retry without its own execution identity — not the storage engine.