How Do You Keep Batch IDs Consistent Across Plant Systems?
To track batch IDs across PLC, SCADA and MES, choose one system to issue the identity and require every receiving system to acknowledge it before recording production against it. Keep that identity attached to each process event, rather than adding whichever batch happens to be active when the event arrives. Define separate rules for starts, ends, splits, rework and corrections so the record follows the material through each handover.
What should the batch ID identify?
Start with a material boundary: what material belongs to this batch, and what event creates or closes that grouping?
Keep the batch ID separate from the production order, recipe, equipment name and execution reference. An order may require several batches; a batch may pass through several equipment operations. Give each operation its own reference while retaining the material identity.
Use one immutable reference for each batch. If operators need a shorter display code, keep an explicit mapping to that reference. Agree how uniqueness is maintained across lines and sites, and whether spaces, letter case or leading zeros have meaning.
Treat the ID as text throughout the interface. Specify its permitted characters and maximum length, and reject values that a receiving system cannot preserve exactly.
Which system should own the identity?
Assign one issuing authority. In a plant with MES, a practical design is for MES to issue the batch identity and for SCADA and the PLC to accept it. Where MES is absent, assign that responsibility to another named application or controlled register.
Distinguish issuing an identity from reporting what happened. The issuer creates the reference; equipment reports when material processing actually starts and ends.
| Responsibility | Recommended ownership rule |
|---|---|
| Create the batch ID | One designated issuing system |
| Approve the assignment to equipment | The application coordinating production |
| Confirm the equipment accepted it | The receiving controller or equipment interface |
| Report actual processing events | The system observing those events |
| Approve a record correction | An authorised role through a recorded workflow |
Document these decisions in the functional design specification, including rejected assignments and unavailable systems. Avoid allowing a screen, controller and MES to create competing identities independently.
What should happen at batch start?
Use an acknowledged handover instead of simply writing a new value into an active-batch tag.
The start request should identify the batch, intended equipment, operation and a unique request reference. Validate that the equipment is available for that assignment and has no unresolved previous batch.
A useful sequence is:
- The coordinating system proposes the assignment.
- The receiver validates and stores the complete assignment.
- The receiver acknowledges the same request and batch references.
- The actual process-start event records those references.
Keep “assigned” and “started” as distinct states. Preparing a batch on a screen should not, by itself, count as material entering the process.
Read the assignment as one consistent set of values. Reject incomplete updates instead of combining a new batch ID with an old operation reference.
Define what happens if acknowledgement never arrives: hold the request, display the reason and provide a controlled recovery route. Any safety-related start restriction should be designed with a qualified assessor.
How should process records carry the identity?
Capture the identity when the event occurs. For each attributable record, include the batch reference, equipment, operation, event type and a unique event reference.
Record both occurrence time and receipt time when messages can be delayed. Use the event's captured assignment to determine attribution; do not reconstruct it solely from the receiving system's current active batch.
Define which measurements belong to a batch. For a shared utility measurement, for example, document any allocation method instead of presenting the whole reading as direct batch consumption.
If communications fail, retain the event with its original identity for later delivery. Specify storage limits, overflow handling and operator visibility. If the same event is delivered again, recognise its event reference and avoid counting it twice.
On restart, reconcile the stored assignment with the coordinating system before accepting new attributable records. Do not silently adopt a default batch.
When should a batch end?
Define the physical end condition for each operation. It might be confirmed discharge, completion of a transfer or an authorised abort. Choose the condition that matches the process.
Separate the end of processing from completion of the record. Equipment may have finished while an inspection result or a delayed consumption message remains outstanding.
At closure, record:
- The batch, equipment and operation references.
- The actual end event and its occurrence time.
- Whether processing completed, stopped early or was aborted.
- Any outstanding transfers, results or reconciliation actions.
An equipment assignment can finish while the material batch continues elsewhere. Likewise, closing a batch should not erase the identity needed to accept a valid late record. Define how those late records are reviewed and attached.
How should splits and rework be recorded?
Use explicit material relationships. Create child identities when separated portions need independent tracking, and retain their connection to the parent.
Illustrative example: batch BATCH-A is divided into BATCH-B and BATCH-C. Record a split event linking both children to BATCH-A, with their quantities and units. Account separately for any remainder, loss or sample; do not force the quantities to agree by changing a child quantity without explanation.
Subsequent processing belongs to the relevant child. Keep earlier records attached to the parent, with the relationship available when tracing either child backwards.
For rework, distinguish another operation on the same material from creation of a new material grouping. A repeat operation may retain the batch ID with a new execution reference. Material combined into another batch needs an explicit input-to-output relationship.
Write the decision rule before production begins. Do not overwrite the original identity merely because the recipe, destination or disposition changed.
How should manual corrections work?
Provide a controlled correction workflow for wrong assignments, missed scans and incorrectly attributed events.
Keep the original value and record the replacement, reason, person making the change and approval where required. Make the current accepted value clear without removing the history.
Separate a corrected display label from a material-attribution correction. Moving a consumption event to another batch requires review of affected quantities, genealogy and downstream records.
If a correction reaches several systems, give it its own reference and track acknowledgements. Show unresolved differences explicitly. A successful screen edit should not be treated as proof that every receiving system accepted the correction.
What common mistakes should you avoid?
Using the current batch tag for delayed events. Require the batch reference captured with the original event.
Using the order number as every batch's identity. Keep the order relationship while giving independently tracked batches distinct references.
Allowing free-text IDs during an outage. Predefine an offline issuing rule, permitted operations and reconciliation process.
Closing the record when equipment stops. Distinguish a pause, an operation end and final record closure.
Renaming material after a split or rework. Record relationships and new executions instead of replacing history.
Testing only a normal production run. Include lost acknowledgements, duplicate messages, restarts, late results and corrections in acceptance testing. Where older controls are involved, include these checks in the PLC retrofit shutdown plan.
What should you prove before handover?
Use a witnessed test checklist with expected results:
- A valid assignment is acknowledged with exactly matching references.
- An invalid or incomplete assignment is rejected visibly.
- A lost acknowledgement can be retried without creating another start.
- Events recorded during an outage retain their original attribution.
- A restart recovers or flags the assignment for reconciliation.
- Split and rework records preserve the material relationships.
- Corrections retain history and expose outstanding acknowledgements.
Finish by tracing a finished material batch backwards to its inputs, operations and corrections. Then trace an input forwards to every recorded destination.
Related reading: adding product and shift context to machine data.
Frequently asked questions
Must every system use the same visible batch code?
Prefer one shared reference. Where a legacy system needs a local code, maintain an explicit mapping and reject ambiguous matches.
Can production continue when MES is unavailable?
Define that policy for the process. Specify which assignments may continue, how identities and events are retained, and when production must wait for reconciliation.
Does every pause need a new batch ID?
Use the material boundary to decide. Record a pause and restart as operation events unless the agreed process rule creates a new material grouping.
Does this approach require a full MES?
No. Apply the same ownership, acknowledgement and attribution rules to the systems you have. Our services cover control-system integration, and our FAQ explains how an engagement works.