← Documentation

OEE and time accounts

Translation for information — the German version is authoritative.

Availability, performance, quality from events, cycles and PMC messages

Copy from the HDTrace repository (docs/). Internal network details have been replaced by placeholders; the version in the repository is authoritative.

OEE and machine states from PMC and FOCAS

Status: Read from two files of a real machine (PMC mnemonics 10622 of a 31i-B and the program memory ALLFLDR.TXT); the read calls and their cost were measured on a real 31i-B (see below). Time accounts, OEE figures and the configuration of the addresses are implemented and checked against the simulator; running OEE operation at the machine has not yet been tried out. The addresses below are those of this machine.

What the control already holds

The machine builder already keeps the state of the plant as a structured bit list in the PMC. That is the decisive insight: for an OEE evaluation nothing has to be derived or guessed, it only has to be read and given timestamps.

1209 plain-text messages in one range

SymbolsBM0000 … BM2054, 1209 of them
AddressesD1344.0 … D1606.x, 155 occupied bytes within a window of 263
Readingone pmc_rdpmcrng over D1344–D1606

Every bit carries its plain text in the symbol table. Examples that answer exactly the questions being asked (original texts in German):

BitAddressText
BM0103D1356.7Warm-up cycle is active
BM0594D1418.2Waiting for loading system
BM0526D1409.6Loading system not ready
BM0567D1414.7Loading system: no workpiece on the blank conveyor
BM0565D1414.5Loading system: finished-part conveyor full
BM0218D1371.2Workpiece not OK, continue? → acknowledge key
BM0655D1425.7Quality inspection stop
BM1372 / BM1379D1515.4 / D1516.3ECO mode: switch-off/switch-on phase of the warm-up cycle
BM0000D1344.0EMERGENCY STOP

The loading system group alone comprises over 90 messages — from “loss of enable during loading/unloading at the machine” to a single faulty axis. That is the level of detail an OEE evaluation otherwise fails at: not “fault, 14 minutes”, but which fault.

The loading steps as a chain

StepAddress (st. 1)Address (st. 2)Text
LA1D2286.0D2300.0Enable LV + hatch + unclamp workpiece
LA2D2286.1D2300.1Enable removal of finished part
LA3D2286.2D2300.2Release clamping device
LA4D2286.3D2300.3Clamping device released
LA5D2286.4D2300.4Loading hatch closed / dressing position reached
LA6D2286.5D2300.5Enable dressing
LA7D2286.6D2300.6Hatch + tailstock + I/O in position after dressing
LA8D2286.7D2300.7Enable loading of blank
LA9D2287.0D2301.0Clamp blank
LA10D2287.1D2301.1Blank clamped
LA11D2287.2D2301.2NC pre-start
LA12D2287.3D2301.3Close loading hatch
LA13D2287.4D2301.4Start grinding

Thirteen steps, not ten or twelve — and both stations lie such that one pmc_rdpmcrng over D2286–D2301 (16 bytes) covers everything. The active step is therefore a display like the step chart of the grinding phases: a chain in which one element is lit.

Alarms

Three sources that complement each other:

  1. CNC alarms — cnc_rdalmmsg2 supplies number, axis and text. One call, only when cnc_statinfo reports an alarm: in undisturbed operation, alarm acquisition therefore costs nothing at all.
  2. Macro alarms from the part programs — #3000=n(TEXT). This program memory contains 325 of them (FALSCHES ABRICHTPROG, F-ID37 CHECK #13037 …). They appear as ordinary CNC alarms and come in by the same route.
  3. PMC messages — the BM bits above. They are not CNC alarms; the machine keeps running and waits. It is precisely these cases that are missing from an evaluation that only knows CNC alarms: “waiting for loading system” is not an alarm, but it is downtime.

Warm-up, held twice

BM0103 (D1356.7) in the PMC and the interface variable #1115 in the NC (IF[#1115EQ1]GOTO9100(WARMLAUF?)). The second is reachable through the macro variable read routine that already exists — a cross-check without an additional round trip, when markers are being read anyway.

The machine's time counters

The PMC holds DWORD counters for operating and production time per spindle (from D1100 on, BETR.ZEIT SSP1 (SEK), PROD.ZEIT SSP1 (STD) …). They are not the basis of the evaluation — they are the cross-check: if the program's own time accounting deviates from these counters by minutes over one shift, the state logic is wrong.

How it is acquired

Rate: like the override

Neither is millisecond-critical. A loading step lasts seconds, a fault minutes. Two additional groups, each with its own divider:

GroupCallsDividerCost per cycle
pmc.meldungen1 (pmc_rdpmcrng D1344–D1606)100,10
pmc.ladeschritte1 (pmc_rdpmcrng D2286–D2301)50,20
alarme1 (cnc_rdalmmsg2)only when an alarm is pending≈ 0

Together 0,3 calls per cycle — against the 6,05 that the cycle costs today, that is the price of one percentage point of polling rate for half the machine state. The dividers are set in the configuration (focas.divisor_pmc, focas.divisor_pmc_meldungen, plus the cycles in focas.pmc_takte).

Storage: edges, not a time series

Recording 1209 bits every 3 seconds would be 400,000 values per hour, five of which change. What is recorded is therefore the change: one event per edge, with timestamp, bit, text and direction. A rising and a falling edge make an interval, and intervals are exactly what an OEE evaluation needs — not sample points.

A day thus produces a few thousand rows, not a few million. That fits in the same store as the event snapshots (docs/aufzeichnung.md) and survives a restart.

Time accounts

The intervals give rise to accounts that must not overlap. Proposed order of precedence (the first that applies wins):

  1. Fault — a CNC alarm or a BM fault message is pending
  2. Waiting for loading system — BM0594, BM0526, BM0567, BM0565
  3. Warm-up — BM0103 or #1115
  4. Dressing — step code category, which the system already knows
  5. Set-up/operator intervention — operating mode ≠ MEM, acknowledgement messages
  6. Productive — cycle running, none of the above
  7. Unplanned downtime — the remainder

The order of precedence is a decision, not a truth; it belongs in the configuration, so that two machines stay comparable.

A simplified version is implemented with five accounts: fault, dressing, set-up/operator intervention, productive and unplanned downtime. Every pending PMC message counts as a fault for now; “waiting for loading system” and “warm-up” do not exist as accounts of their own yet, because that would need a configuration table (which message belongs to which account). The time accounts only run in the cyclic operating mode.

How the three OEE factors are calculated and what is still missing

FactorFrom whatStill missing
Availabilityfault-based: observed time minus fault time, from the time accounts (deliberately no shift model)nothing — set-up and operator intervention do not count as a loss
Performancetarget cycle time divided by actual cycle time (at most 1), from the configured OEE values soll_takt and ist_taktthe address of the actual cycle time at the machine; without it the tile shows only the taught target time and calculates no performance
Qualitygood divided by good plus scrap, from the configured OEE values gut and ausschuss (candidates: BM0218, SPC counters from D5196 on)where the good/scrap count of this machine really lives

The OEE is the product of the three factors and appears only once all three have a value.

Display

Implemented is the dashboard tile OEE with the OEE ring and the time-account bar; pending PMC messages appear with plain text. Intended as displays but not yet built:

  • Loading step as a chain L1…L13 with plain text, coloured like the step chart — next to it, how long the current step has already been standing. A step that otherwise takes 4 s and has now been standing for 40 s is the fault, before it becomes a message.
  • Message log — what was pending, when and for how long, in descending order of total duration. That is the list maintenance actually reads.

Where the addresses are entered (implemented)

Not in the program, but in the Settings → Machine signals tab: one table for individual signals (loading steps, good/scrap, counters) and one for the plant's message list, which can be pasted rather than typed. Both live in the configuration file under focas.pmc_signals and focas.pmc_messages — details in konfiguration.md.

Reading only happens when focas.read_pmc is switched on and at least one address is entered; as long as nothing is entered, no call goes to the control either. The reading itself (pmc_rdpmcrng, one call per range) is bound and was measured on a real 31i-B — see the next section. Entering the addresses of a plant and seeing their read cost, on the other hand, works without a control.

Measured on a real 31i-B (19.08.2026)

Grinding machine, control 31i-B TT (G431 59.0), four channels. hdtrace pmc against the addresses of this plant:

RangeResult
D1344-1606 (263 bytes of messages)rc=0 in a single call, 43 ms
D2286-2301 (loading chain)rc=0, 31 ms, all bytes zero (machine was standing)
10 repetitions41 ms on average per call

The header confirms the mapping: 09 00 00 00 40 05 46 06 are four little-endian shorts — address type 9 (D), data type 0 (byte-wise), start 1344, end 1606. The PMC_BEREICHE table in the driver is therefore correct, and the header is eight bytes long. Measured, not assumed.

The message list is correct as well. Exactly two bits were set, and both make sense for a control cabinet with no operator station connected:

AddressMessageText
D1443.4BM0796Communication CNC–MMC interrupted
D1444.3BM0803Data entry active! End data entry → press cycle start

That confirms the basic assumption of this document: the machine builder's addresses hold, the ranges are readable over FOCAS, and the entire state of the plant costs one call.

One reservation that has consequences: 41 ms per call is above the governor's latency limit (latency_limit_ms, default 40 ms). Anyone who takes the range into the running sampling cycle triggers the adaptive throttling with it — the monitoring would slow itself down. Two ways out: set the limit to 60 ms (the control copes with it, the figure is conservative), or read the range in two halves and query them alternately.

Open questions for the machine

  1. Is pmc_rdpmcrng enabled for the D range? (Option and PMC write/read protection per range.)
  2. Are the BM addresses fixed for this series or different per machine? Whether the mapping table can be shipped with the software or has to be read in per plant depends on that.
  3. Does the machine really have two stations (LA*_2 is present throughout)?
  4. Where does the good/scrap count come from?