# Set up OEE and downtime

> For engineers and administrators (Pro and Enterprise) - turn the module on (production.enabled), check the shift calendars, grant the seven production rights, add a machine in the Studio's Production tab (calendar, plan, the state from a state code map, PackML, conditions or the counter, two of total, good and reject, fault code and product, ideal cycle, micro-stop and gap limits), the reason codes, production plans with breaks and exceptions, ideal cycles per product, the settings, apply the historian logging the source tags need (preview, then apply), and check the first results.

Product: eaxScada · Type: How-to guide · Editions: Pro, Enterprise
Source: https://eaxware.com/docs/eaxscada/how-to/set-up-oee-and-downtime/
Verified against commit 667babf.

## Goal

Measure OEE and downtime on your machines: tell eaxScada how to read each machine's state and counts from its tags, which stop reasons operators can choose, and when production is scheduled.

You need:

- **eaxScada Pro or Enterprise.** Not Starter, not Free.
- To change `config.yaml` and restart the server: access to the server.
- To grant the rights: security administration (Administrator).
- To configure machines, reasons, plans, ideal cycles, the settings and the historian logging: the right `production_configure`.

How the numbers are worked out: [OEE and downtime](/docs/eaxscada/explanation/oee-and-downtime/). OEE and downtime only reads: nothing you set up here writes to a machine.

## 1. Turn the module on

OEE and downtime is **off by default**. On every server (each HA node), add to `config.yaml`:

```yaml
production:
  enabled: true
```

and restart. The other keys of the section (`backfill_days`, `settle`, `write_interval`, `hook_queue`, `retention.intervals`, `duckdb.memory_limit`) have defaults that suit most sites: see [Configuration](/docs/eaxscada/reference/oee-and-downtime/#configuration-production).

The module starts only when **all** of these hold at start-up; otherwise the routes answer `503 PRODUCTION_OFF` and the Studio shows no Production tab:

- `production.enabled` is `true`;
- the licence includes OEE and downtime (Pro or Enterprise). A licence installed while the server runs takes effect at the next restart;
- every `production:` value is valid. A refused value keeps the module off and is written to the server log ("OEE and downtime not started: refused configuration"); the server itself starts;
- the historian has its columnar store;
- sign-in is on: with security off every route answers `403 PRODUCTION_SECURITY_OFF`.

Nothing is computed and no file is created until the first machine is saved.

## 2. Check the shift calendars

A machine follows one shift calendar of `reports.shifts`, the same calendars Analytics and Reports and the shift log use. Define it on every server and restart:

```yaml
reports:
  shifts:
    default:
      - early 06:00
      - late 14:00
      - night 22:00
```

Each line is a shift name and its start on the site's clock (`site.time_zone`); a shift ends where the next one starts. Lines with a different pattern get their own calendar. See [Shift calendars](/docs/eaxscada/how-to/schedule-a-report/#3-shift-calendars-server-configuration).

## 3. Grant the rights

Each right is a feature rule in **Security > Permissions** with the right's name as its pattern ([Add a feature permission rule](/docs/eaxscada/how-to/add-a-feature-permission-rule/)):

| Right | Lets a person |
|---|---|
| `production_view` | See the downtime panel, the OEE figures and the production datasets |
| `production_reason` | Enter and change downtime reasons while the shift is open |
| `production_reason_closed` | Change downtime reasons after the shift has closed (with an e-signature) |
| `production_plan` | Add, change and remove planned stops |
| `production_counts` | Adjust production counts |
| `production_configure` | Configure machines, reason codes, plans, ideal cycles, the settings and the historian logging |
| `production_recompute` | Recompute OEE and downtime over a range of time |

- **A new installation** gets these rules: Shift_Operator `production_view` and `production_reason`; Process_Supervisor those plus `production_reason_closed`, `production_plan` and `production_counts`; Lead_Engineer those plus `production_configure`. `production_recompute` has no rule: only the Administrator holds it.
- **An existing installation gets no rule.** Until you add them, only the Administrator holds the rights (no rule: Administrator only).
- An ALLOW must name the right exactly; `production_*` or `*` grants nothing. A DENY of the right, of `production_*` or of `*` refuses it to everyone, **the Administrator included**.
- The AI co-pilot never holds more than `production_view`, whatever a rule says. API tokens may read (the routes marked token in the [reference](/docs/eaxscada/reference/oee-and-downtime/#http-routes)) and never write.
- Every right also needs the machine: a person sees, and writes for, only the machines all of whose source tags their tag read rights allow.

## 4. Add a machine

Open **Analytics and Reports > Production > Machines** (the tab needs 700 px; it is not offered on a phone) and choose **Add machine**. Pick every tag from the tag browser (**Browse**): a tag that is not in the tag list is refused at save.

**Machine**

- **ID**: letters, digits, `_` and `-`, starting with a letter or digit, at most 64. It cannot be changed later.
- **Name**, **Plant path** (the machine's place in the plant tree, for example `Line3/Filler`; a dataset's tag scope matches it), **Group** (line or area, at most 64 characters, for roll-ups and reason filters).
- **Calendar**: a shift calendar of step 2 (refused if it does not exist).
- **Plan**: a production plan on the same calendar, or **None: scheduled around the clock**.
- **Applies from**: empty means from the moment you save. Earlier results keep the configuration they were computed with.

**State**: **Read the state from**

| Choice | You set |
|---|---|
| **State code tag** | The tag (an integer code) and the **Code map**: rows of codes (whole numbers, several per row), class (Run, Stop, Planned stop, Unknown), label, and **Starved / blocked** for external stops. **A code not in the map is**: Stop (default), Planned stop or Unknown; never Run. At most 1,024 codes, each once. |
| **PackML state** | The **PackML state tag**. Leave the code map empty for the standard PackML map (Execute is run, every other state a stop), or **Use the standard PackML map** to start from it and edit. Optional **Unit mode tag** and **Production modes** (default 1): any other mode is a planned stop. |
| **Conditions on tags** | 2 to 32 rules, each "When all of these hold" or "any of these holds", with rows of tag, operator (`=`, `!=`, `<`, `<=`, `>`, `>=`) and value; at most 8 tags in all. The first rule that matches decides; the last rule is **Otherwise** and cannot be Run. |
| **From the counter** | Only a total count: the machine is running while the total counter moved within the given multiple of the ideal cycle (1 to 100, default 5). Needs a total count from a counter or increment tag and the default ideal cycle. |

**Counts**: set exactly two of **Total**, **Good** and **Reject**; the third is worked out.

| Source | You set |
|---|---|
| **Counter tag** | The tag, and **Rolls over after** (the counter's highest value before it wraps to 0; empty: every decrease is a reset) |
| **Increment tag** | The tag: each logged sample is a number of new units |
| **Genealogy station** | The **Station**, and the **Results that are rejects** |
| **Manual adjustments only** | Nothing (good or reject only: the total is never manual) |

**Highest plausible rate (units/s)**: empty means 1 / ideal cycle. A larger jump is not counted.

**Reason suggestions and product** (all optional)

- **Fault code tag** and **Fault code to reason**: integer fault codes mapped to reason codes of step 5. A stop's suggestion is the fault code at its start; if there is none, the first mapped code logged in the 2 s after the start (while the stop lasts) is suggested.
- **Alarms that suggest a reason**: up to 32 tag paths or prefixes ending in `/>`; an alarm of these that became active from 5 s before to 2 s after a stop's start is suggested.
- **Use the machine's suggestion as the reason without an operator's confirmation**: off by default. On, the suggestion becomes the reason in force.
- **Product tag**: the current product. With a product tag the machine uses the rows of **Ideal cycles** (step 7), never its default.

**Ideal cycle and limits**

- **Default ideal cycle (s per unit)**: 0 (none) to 86,400. Without it the performance is unknown, never 100 %.
- **Micro-stop below (s)**: above 0, at most 3,600 (default 120).
- **A value holds for at most (s)**: the gap limit, 1 to 86,400 (default 120). After that without a new point the input is missing.

**Save.** The server checks the machine against the calendars, the plans, the reason codes and the tag list, and shows each problem at its field. A machine already saved by someone else since you opened it is not saved over: **Reload**. **Delete** asks first; a deleted machine is no longer computed from then on, and its results and recorded reasons stay.

In the grid, a machine with a problem carries a marker (amber or rose) with a card explaining it: a source tag not found, a missing plan or one on another calendar, no ideal cycle (or none per product), an unknown reason in the fault map, historian logging that does not fit (step 6), or what the server reports (**Not computed**, **Computing failed**, **Waiting for a recompute**). The chip above the grid filters to them.

## 5. Add the reason codes

Open **Reason codes**. The tree has at most three levels (category > reason > detail) and 2,000 codes. **Add category**, then **Add under** on a row:

- **Code**: upper-case letters, digits, `_` and `-`, at most 48 (`R-JAM-INFEED`), unique.
- **Label** in English (required) and optionally German, French, Spanish and Italian, at most 120 characters each.
- **Planned downtime (does not lower availability)**: for breaks, planned maintenance, no order.
- **The operator must write a comment** (for "Other").
- **Machine groups**: offered only on machines of these groups; empty, every machine.
- **Active (can be chosen)**.

**Save reason codes** saves the whole tree as one document. A code already used by recorded reasons is best **Set inactive** rather than deleted: it stays readable in history and can no longer be chosen. There is no built-in tree: you add your own.

## 6. Apply the historian logging

Each source tag must be logged by the historian on every change with the right heartbeat ([why](/docs/eaxscada/explanation/oee-and-downtime/#final-and-provisional-rows)):

| Tag used as | Logging OEE needs |
|---|---|
| state, unit mode, condition input, fault code, product | on change, deadband 0, no minimum interval, heartbeat = half the gap limit (60 s by default) |
| counter | on change, deadband 0, minimum interval at most 1 s, heartbeat 60 s |
| increment | on change, deadband 0, no minimum interval, no heartbeat |

1. In **Machines**, a machine whose tags do not fit carries **Historian logging does not fit**. Open its logging card: each tag with what OEE needs, what logs it now (a rule or the server's default policy), and why it does not fit.
2. Choose **Apply logging rules** (one machine, or every machine whose logging does not fit). The dialog first shows the server's **preview**: exactly the rules that will be created or changed, before and after, and what is expected to stay unresolved. Nothing is changed or recorded yet.
3. Confirm. The server records the change first (`LOGGING_RULES_APPLIED`, with every rule before and after), then saves each rule through the historian's rule API: on change, deadband 0, no trigger, enabled, with the required heartbeat. The result shows what was set and what still does not fit.

The apply changes only rules whose target is exactly a source tag of the machines named. **A tag's other rules are never changed or deleted**: what they still break is listed as unresolved ("Change or remove the other historian rule of this tag in the historian settings"). A tag two machines need both as an increment and with a heartbeat cannot fit both.

Historian rules are per server: the apply changes this server's historian, and the other HA server applies the same rules from the replicated record. If the server does not report its default logging policy, a tag without its own rule never counts as fitting.

Without the logging the machine is still computed, but with the wrong timing: a tag that is quiet for longer than the gap limit reads as missing, and changes inside a deadband are never seen.

## 7. Add plans and ideal cycles

**Plans**: **Add plan**, an id, the calendar, then per weekday the shifts scheduled for production (tick them; none: not scheduled that day). **Breaks (every scheduled day)**: shift, start (HH:MM, site clock), 1 to 480 minutes, optional planned reason; a break must fit inside its shift and not overlap another. **Date exceptions**: a date (YYYY-MM-DD) and the shifts scheduled that day only (none: a holiday). At most 64 breaks and 1,000 exceptions. A plan still used by a machine cannot be deleted. A machine without a plan is scheduled around the clock.

**Ideal cycles**: one row per machine, product and start time (seconds per unit above 0, at most 86,400). **Save ideal cycles** saves them all. A machine with a product tag uses only these rows; a product without a row has an unknown performance.

## 8. Settings

- **Incomplete data below (% of the time covered)**: default 95. An OEE row with less data is marked **Incomplete data**.
- **Shift closes for reasons after (hours)**: default 8, at most 168. After that a change of reason needs `production_reason_closed` and an e-signature.
- **Line OEE: the constraint machine of each group**: the machine whose OEE is the line OEE.

## 9. Check the first results

- The **Server** column of **Machines** says **Live** once the machine is computed (**Recomputing** while the history of the backfill, 30 days by default, is worked out).
- Operators with `production_view` see the **Downtime** button in the operator runtime: [Enter downtime reasons](/docs/eaxscada/how-to/enter-downtime-reasons/).
- Reports and dashboards read the results through datasets of the family **production**: [Create a report dataset](/docs/eaxscada/how-to/create-a-report-dataset/) and [the production family](/docs/eaxscada/reference/oee-and-downtime/#dataset-family-production). To report on it, choose **Add OEE datasets** in **Analytics and Reports > Schedules** (needs `datasets_edit` and `production_view`): the ten starter datasets appear under **Datasets** ([Starter datasets](/docs/eaxscada/reference/oee-and-downtime/#starter-datasets)).

## Troubleshooting

| You see | Do this |
|---|---|
| No Production tab | Check step 1 (enabled, licence at start-up, valid `production:` values, sign-in on) and that you hold a production right. The tab is never shown as an upgrade advertisement. |
| `503 PRODUCTION_OFF` | The module does not run on this server: see step 1 and the server log. |
| **Not listed by the server** on a machine | Your tag read rights do not cover every source tag of the machine. |
| **Not saved: your tag read rights do not cover every source tag of this machine** | A machine can only be saved by someone who may read all its tags, before and after the change. |
| `409 ha_standby` | Configure on the HA primary. |
| `503 AUDIT_NOT_WRITTEN` on the logging apply | The audit trail cannot write: nothing changed. [When the audit trail is down](/docs/eaxscada/how-to/when-the-audit-trail-is-down/) |
