# Condition-Based Maintenance

Some maintenance should follow how hard an asset works, not the calendar. A **Condition** template raises a work order when
an asset's run hours or a counter reach a threshold, or when a tool's life comes due. Technicians respond as in
[Condition-Based Work](../8-maintenance-technician/4-condition-based-work.md).

## Create a Run-Hours Template

For example, CoreForge's spindle service on Machine 1.

1. Open **Configuration → Maintenance → Work Orders** and add a template on the **Work Orders** tab.
2. Fill in the details:

   | Field | Example |
   | --- | --- |
   | Title | `Machine 1 - Spindle service` |
   | Asset | `CoreForge\Philadelphia\Machining\Machine 1` |
   | Maintenance type | Preventive |
   | Work type | `Spindle Service` |
   | Priority | Medium |
   | Schedule type | Condition |

3. In the **Condition** section, choose `Run Hours` and enter the interval in hours.
4. Set **Last serviced on** and **Last value** to say where the count starts.
5. Save the template and set its version status to **Released**.

![Run hour condition](https://docs.kanoa.ai/img/cmms/conditionRunHour.png)

Choose **Counter** instead to trigger on an asset counter, such as parts made.

![Counter condition](https://docs.kanoa.ai/img/cmms/conditionCounter.png)

:::warning
Releasing a Condition template starts the checks straight away. Set **Last serviced on** and **Last value** correctly, or a
work order may be raised before it is due.
:::

{/*
TODO: Confirm on a gateway what Last serviced on and Last value do when a Condition template is first released, whether
a work order can be raised immediately, and the interval field for Counter. The Developer Training uses 1 hr, Last serviced
on set to now and Last value 0, and notes that conditions are checked periodically so a work order can appear shortly after
the threshold.
*/}

## Use Tool Life

**Tool Life** is only offered when the template's **Asset** is a tool, such as a mold, so select the tool first.

1. Set **Asset** to the tool.
2. Choose **Tool Life** as the condition.
3. Set **Due for** to the tool limit the work order covers: its PM, refurbishment or calibration.

A work order is created when the tool reaches its **Warn at %** of that limit. Completing the work order resets the count,
the same as recording it on the tool's **Life** tab. The work orders for a tool are listed on the **Maintenance** tab of its
tool editor.

![Tool life condition](https://docs.kanoa.ai/img/cmms/conditionToolLife.png)

::embed-section{src="../../kanoa-cmms/workOrderTemplate.md#schedule-types" collapsed="true" summary="Reference Materials: Schedule Types - One Time, Recurring and Condition."}

::embed-section{src="../../kanoa-ops/tooling/tool-life.md#with-kanoa-maintenance" collapsed="true" summary="Reference Materials: Tool Life with Kanoa Maintenance - How a tool raises a work order."}

## Worked Example

The CoreForge sample plant raises a spindle service on Machine 1 from its run hours, the same as Developer Training.

::embed-section{src="../../training/7-training-maintenance/02-work-orders/4-condition-based.md#create-the-condition-template"}

## Check Your Understanding

1. Name three conditions that can raise a work order.
2. When is the **Tool Life** option offered?
3. What does completing a tool-life work order do?

<details>
<summary>Answers</summary>

1. Asset run hours, a counter value, or a tool's life reaching its **Warn at %**.
2. Only when the template's **Asset** is a tool, such as a mold.
3. It resets the tool's count for that limit, the same as recording it on the tool's **Life** tab.

</details>
