# Configure Performance Reasons

Performance reasons are organized like the other Kanoa reason codes:

- **Performance state classes** act as folders for related reasons, for example by area or by cause (equipment, material, labor, process).
- **Performance states** are the reasons themselves, each with a name and a color used in reports.
- **Links** to assets (and optionally items) control where each reason can be selected, so an operator on Machine 1 only sees reasons that make sense for a machining center.

:::action[Create the Machining performance reasons]

1. Navigate to **Configuration → Ops → Performance Reasons**.
2. Create a performance state class named `Machining`.
3. Under `Machining`, create these performance reasons, giving each a distinct color:

   | Reason | Typical cause |
   |---|---|
   | `Tool Wear` | Feed rate reduced to protect a worn cutting tool |
   | `Coolant Flow Low` | Spindle speed reduced while coolant pressure recovers |
   | `Material Hardness Variation` | Harder bar stock forcing slower cuts |
   | `Operator Pacing` | Manual load/unload slower than the cycle allows |

4. Open each reason with the edit button and confirm its class, color, and that it is enabled.

:::

:::action[Link the reasons to Machine 1]

1. On the same screen, click on the `Performance state Links` tab and select the `Machining` class so all four reasons are included.
2. In the asset section, find **Machine 1** (`CoreForge\Philadelphia\Machining\Machine 1`).
3. Click the link button to link the reasons to the asset.

:::

:::note[Linking matters]
Reasons that aren't linked to an asset don't appear when someone codes a performance event on that asset. A reason for a jammed tape applicator on a packaging line shouldn't be selectable on a machining center.
:::

:::check

Copy this script into the Ignition Designer Script Console (**Tools → Script Console**) and run it. It checks the `Machining` class, the four reasons (name, class, enabled, distinct colours) and that each one is linked to `Machine 1`. It doesn't change anything.

<details>
<summary>Show the check script</summary>

::check-script{src="ops/08-performance-events/1-configure-performance-reasons.py" title="checkLesson-performanceReasons.py"}

</details>

:::
