New: the AI firewall watches every module and explains each incident in plain words. See how it works

Production tracking with machine states and counters

A blueprint for collecting run states, part counters and stops from old and new machines: state model, point list, availability and output measures, stop alarms, sizing and rollout.

At a glance

ItemTypical answer
ProblemOutput and stops are written on shift sheets and typed in the next day, so nobody knows during the shift whether a line is behind, and stop times are guessed.
What is connectedRun state, good and reject counters, cycle time and stop reason codes from machine PLCs, and stack-light and cycle signals from machines without a usable PLC, through licensed gateways on the shop floor.
Who uses itLine supervisors and team leaders, production and maintenance managers, process engineers, and the planning or ERP team.
Typical first scopeOne line or one cell of eight to fifteen machines, ideally mixing a modern PLC machine and an old relay machine.
Time to first screenTypically a few days after the first machine is wired. Budget three to six weeks for a pilot whose counts the supervisors accept as the shift record.
Estimates depend on how many machines need signals tapped by hand.

The situation

A discrete manufacturing plant typically has machines from four decades on the same floor: CNC machining centres with networked controls, presses and assembly stations on mid-range PLCs, and older special machines whose only interface is a stack light and a mechanical counter. Production figures come from operators: a tally at the end of each hour or shift, stop times rounded to the nearest quarter, and a reason chosen from memory.

The effects are well known. Small stops of two or three minutes never reach the sheet and quietly cost more output than the big breakdowns. A machine waiting for material looks the same as a machine waiting for maintenance. Supervisors learn on the next morning that night shift was 20 % short. Improvement projects argue from opinions, and the ERP receives quantities a day late.

The goal here is modest and achievable: an automatic record of when each machine ran, how many good and rejected parts it made, and when and how long it stopped, visible live on the floor and available to other systems. Detailed MES functions such as order booking and reason entry by operators are a separate step, covered at the end.

Goals and measures

Agree the state model and the definitions with production before connecting anything; arguments about definitions later cost more than any wiring.

  • Availability = run time ÷ planned production time. Planned time excludes breaks and planned maintenance; record the shift pattern on the line asset so everyone uses the same calendar.
  • Performance = (total parts × ideal cycle time) ÷ run time. The ideal cycle time per part number is a property of the product, kept in the machine's attributes or the ERP.
  • Quality = good parts ÷ total parts, from separate good and reject counters.
  • OEE = availability × performance × quality. Hermetry provides the inputs; compute OEE where your production reporting lives, or in a small compute script on a board card.
  • Stops = number of transitions into a stopped state per shift; mean time between stops = run time ÷ number of stops; mean stop duration = stopped time ÷ number of stops.
  • Output against target per hour = parts made ÷ target per hour, the figure supervisors steer by during the shift.

Prefer counters over events. A machine's total part counter, reject counter and run-seconds counter, read every minute, give exact hourly and shift figures through Hermetry's increase aggregation, which also copes with a counter that resets at shift change or power-up. Where a machine cannot provide a run-time counter, sample a 0/1 running value at a fixed rhythm, for example every 30 seconds, and read the hourly average as the share of time running.

Architecture

One licensed gateway running Hermetry Edge per cell or line section, in a cabinet near the machines. Modern machines are read over Modbus TCP on the machine network, or Modbus RTU where the PLC has a serial port: the gateway polls a small block of registers that the machine's PLC programmer exposes. Old machines get their stack-light outputs and a cycle-complete signal wired, through interposing relays, to the gateway's digital inputs; whether the gateway counts pulses on an input depends on its model, and a small remote I/O module or PLC can do the counting where it does not. Every machine appears as a child device of its gateway, with its own profile, history and alarms. See Hermetry Edge and the licensed devices.

ComponentRoleNotes
Licensed gateway with EdgePolls PLCs, reads contacts, publishes telemetryOne per cell or 10 to 20 machines. Claimed by scanning its code.
Machine PLC register blockState, counters, cycle time, part number, reason codeAgree one register layout for all machines, mapped once by each PLC programmer.
Interposing relaysIsolate stack-light and cycle signals of old machinesNever draw gateway inputs directly from machine safety circuits.
Remote I/O or small PLCCounts fast cycle pulses where the gateway model does notExposes counters over Modbus to the gateway.
Energy meter per machine, optionalkW and kWhDistinguishes idle from running on machines without signals; Modbus on the same line.
Plant network or licensed routerOutbound connectionThe gateway needs only an outbound MQTT connection with TLS; nothing on the floor accepts connections from the internet.
HermetryStorage, aggregates, alarms, rules, flows, boards, SCADAEU, US or Türkiye region, or on your own servers.

Point list

One register layout for every PLC machine, and a reduced set for signal-only machines. Register numbers are examples of a block the PLC programmer reserves, starting at holding register 41001.

PointTelemetry keyUnitSourceIntervalNotes
Machine statestatecodePLC 41001, or derived from stack lighton change + 60 s1 running, 2 idle or starved, 3 blocked, 4 stopped by fault, 5 setup, 6 planned stop, 0 off.
Runningrunning0/1PLC 41002 or green stack light30 s fixedFixed rhythm so the hourly average is the run share.
Run time counterrun_ssPLC 41003-41004 (32-bit)60 sPreferred source of run time.
Total partscount_totalpartsPLC 41005-41006 (32-bit), or cycle pulses60 sNever reset by the gateway.
Rejected partscount_rejectpartsPLC 41007-4100860 sGood = total minus reject.
Last cycle timecycle_ssPLC 41009, tenths of a secondon change, at most every 10 sScale value / 10 in the gateway map.
Stop reason codestop_reasoncodePLC 41010, set by the HMIon changeOnly if the machine HMI lets the operator pick a reason.
Active alarm numberalarm_nocodePLC 41011on change0 when no alarm is active.
Part numberpart_notextPLC string or ERPon changeLinks counts to the ideal cycle time.
Program numberprogram_nonumberCNC controlon changeCNC machines.
Automatic modeauto_modeboolPLC or selector contacton change
Red stack lightlight_redboolGateway input via relayon changeSignal-only machines.
Yellow stack lightlight_yellowboolGateway input via relayon changeOften waiting or warning.
Green stack lightlight_greenboolGateway input via relayon change
Machine powerp_kwkWEnergy meter60 sOptional; idle power is waste too.
Machine energykwhkWhEnergy meter15 minOptional; energy per part.
Spindle loadspindle_load_pct%CNC control60 sCNC only; tool wear indicator.
PLC communicationplc_comm_okboolGateway Modbus status60 sFalse when the gateway cannot read the PLC.
About 12 keys for a PLC machine and 6 for a signal-only machine. Use identical keys on every machine of a kind.

For signal-only machines, derive state from the stack light in the gateway configuration where the model allows, or in a Script block in the profile's root flow: green steady is running, yellow is idle, red is fault, all off with power on is stopped. Declare every key in the profile's Telemetry keys tab with label, unit and decimals, and write the state code meanings into the key's label or the profile description so every board shows the same words.

Asset model

  • Plant (Site) with time zone and shift_pattern (for example three shifts 06:00, 14:00, 22:00).
  • Hall (Building) with hall_manager.
  • Line or cell (Line) with target_per_hour, planned_breaks, supervisor_group and bottleneck_machine.
  • Machine (Machine) with machine_no, ideal_cycle_s, machine_type (CNC, press, assembly, special), criticality and install_year.

Place each machine's child device on its machine asset and the gateway on the line. Add Feeds relations between machines in material-flow order, so a blocked machine can be read against the one after it. The line's status is the worst of its machines, so the hall's site table shows at once which lines have a machine in fault. Rules written on a line act only on its machines, and an access policy on a hall gives a hall manager every line in it and nothing else. Put ideal_cycle_s and target_per_hour as attributes where both boards and rules read them.

Device setup

Profiles. One profile per machine kind: PLC machine, standard block, CNC machine, Signal-only machine, and one for the gateway. A profile holds keys, alarm rules, the online rule and its root flow. Use the Recent message online rule with a 60-second expected interval and a factor of three.

Provisioning. The administrator claims each gateway by scanning its code and places it on its line. Machines appear as child devices the first time the gateway reports them; name them in the gateway configuration after the machine number on the floor, such as M-214, so people find them by the name painted on the machine.

Settings. Remote device settings on licensed gateways expose the Modbus map, polling intervals, input configuration and, where the model has it, input counting and state derivation. Make one baseline per line type, dry-run it, and apply it to the other gateways with a bulk job in waves; a job pauses itself if fewer than 95 % of answering gateways apply it. Changes to the register layout are then one baseline change, not twenty site visits.

Intervals and exceptions. Send state and the stack lights on change, plus the state again every 60 seconds as a heartbeat. Read counters every 60 seconds; reading on every part wastes messages on fast machines and adds nothing, because increase gives the exact count per bucket. Send cycle_s on change but at most every 10 seconds. Keep running on its fixed rhythm with no deadband, or the hourly average stops meaning run share. If the gateway model has a deadband setting, use it for spindle load and power only.

Time. Shift figures depend on clocks. Synchronise gateway clocks, or leave time stamps out and let Hermetry stamp the arrival. Licensed gateways buffer readings while the link is down, within a capacity that depends on the model, and send them with original time stamps; because counters are cumulative, a shift total stays correct after an outage even if some intermediate readings were lost. Firmware for gateways is signed and rolled out in waves with a soak time; plan waves for weekends or planned stops.

Dashboards

BoardAudienceWidgets and what they show
Line liveOperators, supervisorsState card per machine coloured by state; stat of parts this hour against target_per_hour; progress card of shift output against shift target; bar chart of good parts per hour for the last 12 hours (increase of count_total minus count_reject); alarm table of open stop alarms. Shown on a screen at the line through a read-only display link.
Hall overviewHall and production managersDevice table of every machine with state, part number and last seen; site table of lines with their status; stat with trend of yesterday's output against the previous period.
Machine pageProcess and maintenance engineersLine chart of cycle_s against ideal_cycle_s; heatmap of run share by hour and weekday; table of stop reasons and alarm numbers over 30 days; spindle load or power trend. Opened from the line board by clicking a machine.
Shift reviewSupervisors, managersBar chart of output per machine per hour across the last three shifts; run share per machine; count of stops per machine; table of hourly figures downloadable to Excel.

A compute script on a card can sum the hourly buckets of the current shift into one figure and apply the shift pattern from the line's attributes; keep such scripts in one shared card definition so every line computes shift figures the same way. Entity parameters let one line board serve every line: the line is the parameter, and every card follows it.

SCADA screens

A floor layout is often more useful than a process diagram here. Draw each hall once, to scale, with machine symbols where the machines stand. The Factory pack has machine tools, presses, robot arms, gantry robots, nutrunner stations, leak testers, workstations, conveyors, palletisers and control cabinets; the MES symbols in the core set add andon boards, andon call stations, operator terminals, inspection stations, end-of-line testers, reject bins and WIP buffer lanes. See the SCADA library.

  • State colours: every machine symbol takes its colour from state: green running, yellow idle, orange blocked, red fault, blue setup, grey planned stop or off. Use the same colours as the stack lights.
  • Labels: each machine prints its parts this hour and its last cycle time; a rule makes the cycle time label blink when it exceeds ideal_cycle_s by 20 %.
  • Andon: an andon board symbol per line, bound to the bottleneck machine's state, shows at a glance whether the machine that sets the line's pace is running.
  • Stale data: a rule greys a machine whose plc_comm_ok is false, so a frozen value is never taken for a running machine.
  • Reuse: identical cells share one drawing attached as a view on the line; Match everything proposes a device for every unbound symbol. Clear the Problems tab before applying, and offer a 3D view of the hall for visitors and training.

Rules and alarms

Profile alarm rules handle value conditions; rules in a line's Rules card handle anything that depends on the time of day or on how long a state lasts.

AlarmConditionDelay and hysteresisSeverityNotifiedEscalation
Machine faultstate == 4Debounce 60 sMinorLine supervisor, push and in-appRules card raises Major if it stays so for 15 min
Long stopRules card: state != 1 and stays so for 20 min, only in shift hoursMajorSupervisor and maintenance, pushReminder every 30 min
Bottleneck stoppedRules card: state of the bottleneck machine != 1, stays so 5 min, only in shift hoursMajorSupervisor, push and SMSReminder every 15 min
Slow cyclescycle_s > attribute cycle_alarm_sDebounce 10 samples; hysteresis 1 sWarningProcess engineer, in-appNone
Reject rate highFlow: rejects in the last hour above 3 % of partsMajorQuality and supervisor, pushReminder every hour
Machine data lostplc_comm_ok == falseDebounce 3 samplesWarningAutomation engineer, e-mailNone
Gateway offlineInactivity, 5 minMajorAutomation engineer and supervisor, pushReminder every 30 min

Profile alarm rules debounce on the device's own time stamps, so a time debounce only advances when readings arrive; that is why state is repeated every 60 seconds. The Rules card's "stays so for N minutes" wait runs on a timer and fires on time even if nothing new arrives, and a message that ends the condition cancels it. Its Only if time window keeps stop alarms quiet during breaks and the weekend. The reject-rate alarm needs arithmetic over a window: a branch in the profile's root flow with a Statistics or Counter block on the reject and total deltas raises an alarm through Raise alarm when the ratio crosses the limit.

Alarms are acknowledged by the person who takes them (User role) and resolve when the machine runs again. One alarm stays open per machine and type and counts occurrences, so twelve short faults on a press in a shift show as one alarm with twelve occurrences, itself a useful signal. Put the first checks for each alarm number in the runbook text. During a planned changeover or maintenance, switch the cell to Manual on its Rules card for a set time, or mute single machines (at most 90 days); muted alarms are recorded but page nobody. Above 20 notifications a minute, Hermetry sends a five-minute digest instead; send stop alarms to the supervisor of the line, not to the whole plant.

Automation and integrations

  • ERP quantities: the ERP pulls hourly good and reject counts per machine through the REST API with a read-only API key, using GET /api/telemetry/series with agg=increase and bucket=1h, and books them against the running order there.
  • State events to MES: a branch in the profile's root flow passes state through an Only changes block and posts each transition, with machine name and time stamp, to an MES endpoint with HTTP request.
  • Maintenance: signed alarm.created and alarm.cleared webhooks for fault alarms open and close work requests in the CMMS, with the alarm number in the payload.
  • Exports: shift review tables download to Excel. Scheduled, e-mailed reports are not built in today.

Order booking, downtime reason entry by operators, labour reporting and full OEE reporting are MES functions. They belong to Hermetry Forge, which is planned after the IoT launch and not available today, or to the MES you already run, fed with the data above. This design sends no commands to machines.

Roles and access

WhoRole or groupCan
OperatorDisplay link on the line screenRead-only view of the line board; no account needed on the shared screen.
Line supervisorUser, policy limited to their linesLine boards and alarms, acknowledge, switch a cell to Manual.
Production managerUser + IoT viewer groupEvery board and table, downloads.
Process and maintenance engineersUser + IoT operator groupMachine pages, alarms, acknowledge, mute single machines.
Automation engineerAdminProfiles, gateway settings and baselines, flows, rules, drawings, firmware.
IT ownerOwnerMembers, sign-in policy, API keys for the ERP.

Display links expire after a set time between 1 and 365 days and can be revoked; renew them on a schedule. The audit log records sign-ins, rule and profile changes, Manual switches and setting jobs in a hash chain that can be verified and exported.

Sizing and data

As an order of magnitude, for 40 machines on three shifts:

  • Counters and fixed-rhythm values: one message per machine per minute, 40 × 1,440 = 57,600 messages a day. If running is sampled every 30 seconds in its own message, add the same again.
  • State changes and cycle times: allow about 300 messages per machine per day, 12,000 a day.
  • About 70,000 to 130,000 messages a day, roughly 2 to 4 million a month. Telemetry and attribute messages count toward the allowance; alarms and connection events do not.
  • Values: about 8 keys per message, some 600,000 to 900,000 values a day, in the order of 250 to 330 million a year.

Group running with the counters in one 30-second message to stay at the lower end. One gateway serving 15 machines sends about 15 to 30 messages a minute, far inside the default limit of 300 a minute. Raw readings are kept for at most 90 days; hourly and daily aggregates of the counters, kept for the plan's full retention class, carry the long-term output history at a fraction of the volume. Storage per value depends on the deployment; ask us to confirm the estimate.

Rollout plan

PhaseWeeksWorkExit criteria
0. Definitions1-2State model, counter definitions, register block, shift pattern, targets; survey which machines need signal taps.Signed state model and register layout.
1. Pilot cell3-6One cell with a modern and an old machine. Profiles, line board, floor drawing, stop rules.Two weeks where Hermetry counts match the supervisors' tallies within an agreed tolerance; stop times agreed as more accurate than the sheet.
2. First hall7-12All machines of the hall; PLC programmers add the register block line by line.Shift sheet replaced by the shift review board for that hall.
3. Integration13-16ERP quantity pull, MES state events, CMMS webhooks.Quantities in the ERP within an hour of production.
4. PlantFrom 17Other halls; energy meters on the largest machines.All machines reporting; weekly review uses the boards.

Commissioning checklist

  1. Gateway claimed and placed on its line; every machine appears as a child device under its floor name and is placed on its machine asset.
  2. Each state code forced once with the operator: running, idle, fault, setup, planned stop, off; the board shows the right colour each time.
  3. Counters compared with the machine display over a full hour: count_total and count_reject increases match exactly.
  4. 32-bit counters checked across the 65,535 boundary, or by writing a large test value in the PLC, to prove word order.
  5. cycle_s scaling checked against the HMI.
  6. Counter reset tested: a reset at power-up or shift change does not produce a negative or giant hourly bar.
  7. Long stop rule tested in shift hours and confirmed silent during a break.
  8. Gateway uplink unplugged for 15 minutes during production: offline alarm opens; afterwards the hour's count is complete.
  9. Line board on the display link shows on the line screen; the drawing has nothing in the Problems tab.

Pitfalls

  • No agreed state model. If idle, blocked and starved are not defined, every board is argued over. Define states first.
  • Counting events instead of counters. A message per part loses parts during outages; a cumulative counter never does.
  • Resetting counters from outside. Let the PLC count forever and let increase find the shift figure.
  • Signal taps on safety circuits. Use interposing relays and leave e-stop and guard circuits alone.
  • Fault alarms to everyone. Route stop alarms to the line's supervisor and use time windows, or people mute the app.
  • Treating the screen as the order system. Counts per machine are not counts per order; booking belongs to the ERP or MES.

What Hermetry does not replace

Hermetry records what machines do and alerts people; it does not control them. Machine control, safety circuits and interlocks stay in the machine PLCs and safety relays and must work when the link or the platform is unavailable. Order management, booking, labour reporting and the official production record stay in your ERP or MES; Hermetry Forge, which will add MES functions, is planned and not available today.

See your field data live this week

Start a trial in your region with your first devices, or book a demo and bring your own use case.