# A New Press

Injection Press 1 arrives with its configuration already worked out by CoreForge's engineers: the new **Molding** area,
the press itself, the two end caps it will make, and its production rates. In this lesson you'll import that, turn on
tooling for the press, and connect it to the simulator.

## Import Injection Press 1

The asset model file holds more than the press. An asset import brings in everything in the file, so importing it
adds:

- The `Molding` area, with `Injection Press 1` in it. The press is OEE-enabled, with its modes and the 4 default
  states.
- Two new items, the end caps `EC-25` and `EC-32`, in a new `CoreForge\WIP\Molded` item class.
- A production rate on `Injection Press 1` for each cap.

:::action[Import the Injection Press 1 asset model]

1. Download <a href="/files/ops-resources/coreforge-press-1-asset-model.json" download="coreforge-press-1-asset-model.json"><code>coreforge-press-1-asset-model.json</code></a>.
2. Navigate to **Configuration → Ops → Assets** and import it with the import/export button.
3. In the asset tree, expand `CoreForge\Philadelphia`. It now has a `Molding` area with `Injection Press 1` in it.
4. Select `Injection Press 1`. It's OEE-enabled and isn't in an asset group. It has only the 4 default states, not the
   downtime states you linked to `Machine 1`; that's all this course needs.
5. Navigate to **Configuration → Ops → Materials**. The **Items** tab has `EC-25` and `EC-32` in the `Molded` item
   class, and on **Production Rates**, `Injection Press 1` has a rate for each cap.

:::

Injection Press 1's rates for the two caps:

| Item | Standard Rate | Scheduled Rate | Infeed / Outfeed Units | Package Count |
| --- | --- | --- | --- | --- |
| `EC-25` | 20 a minute | 18 | units | 1 |
| `EC-32` | 8 a minute | 7 | units | 1 |

These are the rates from the press maker's quote, before the molds arrived. Injection Press 1 is measured in caps going
in and caps coming out, so its package count is 1. Once a mold is mounted, its rate takes over from these.

:::info[Machines measured in other units]
A mold's cavities always count **parts**. If a press were rated in pounds of resin going in instead, the **Package
Count** of its rate (the pounds of resin in one cap) would convert the mold's caps into pounds. See [Cycle Rates and
Item Rates](../../../kanoa-ops/tooling/rates.md).
:::

## Let Injection Press 1 Use Tooling

A tool can only be mounted on a machine that has **Uses tooling** turned on, and only OEE-enabled machines can have it.

:::action[Turn on Uses tooling for Injection Press 1]

1. In **Configuration → Ops → Assets**, select `Injection Press 1`.
2. On the info tab, next to **OEE Enabled**, tick **Uses tooling** and save.
3. In the Designer's Tag Browser, expand the `[Kanoa]` provider's `CoreForge/Philadelphia/Molding/Injection Press 1`
   folder. Next to the `Line` tags there's now a `Tooling` folder.

:::

The `Tooling` folder is an instance of the `assetTooling` UDT. Its **Inputs** let a PLC mount molds, block cavities and
count shots; the rest shows what's mounted.

## Connect Injection Press 1 to the Simulator

The CoreForge simulator needs a press too. Its tags are in a separate file, so importing them doesn't touch the
simulator tags your other machines are using.

The simulated press only shoots while a mold is mounted and an item is running. It takes its speed from the mounted
mold's cycle rate, and counts its shots every 2 seconds, so you can watch the counts climb on the Operator Station.
Kanoa does the rest: each shot makes one cap in every cavity of the mold that
isn't blocked, and counts toward the mold's life.

:::action[Import and connect the Injection Press 1 simulator]

1. Download <a href="/files/ops-resources/coreforge-press-1-sim-tags.json" download="coreforge-press-1-sim-tags.json"><code>coreforge-press-1-sim-tags.json</code></a>.
2. In the Designer's Tag Browser, select the `[Kanoa]` provider and click **Import Tags** from the three dots, as in
   [Connect Tags](../01-base-configuration/7-connect-tags.md). Import from the top-level **Tags** folder, and set
   **Collision Policy** to **Overwrite**. The file holds only Injection Press 1's simulator tags, so it doesn't touch
   the other machines' tags, and importing it again repairs them instead of failing with *already exists*.
3. Confirm `CoreForge Sim/Site/Molding/Injection Press 1` now has `sim`, `assetInputs` and `toolingInputs` folders, and
   that `sim/state` and `sim/shots` show no error icon.
4. Edit Injection Press 1's `Line` tag (`[Kanoa]CoreForge/Philadelphia/Molding/Injection Press 1/Line`) and set its
   **MQTT path** parameter to `[Kanoa]CoreForge Sim/Site/Molding/Injection Press 1/assetInputs`.
5. Edit Injection Press 1's `Tooling` tag (`[Kanoa]CoreForge/Philadelphia/Molding/Injection Press 1/Tooling`) and set
   its **MQTT path** parameter to `[Kanoa]CoreForge Sim/Site/Molding/Injection Press 1/toolingInputs`.

:::

The `Line` tag now reads Injection Press 1's state from the simulator, and the `Tooling` tag reads its shot count into
`Tooling/Inputs/Cycle Count`. Kanoa turns each shot into Injection Press 1's outfeed: the caps the mounted mold's
cavities make. So the simulator leaves the `Line` tag's own infeed and outfeed counts at 0, and on a real press you'd
leave them unbound too, pointing only the state and the shot counter at the PLC. Nothing counts the resin going in, so there's no infeed
count of its own: Run Review and the info panel show Injection Press 1's infeed equal to its outfeed.

In `Tooling/Inputs`, `Cycle Count` reads 0 until the press starts shooting. `Blocked Positions`, `Tool Shot Counter` and
`Tooling` show *Bad_NotFound*. That's expected: the simulator only provides a shot count, and you'll mount molds and
block cavities from the screens instead. Kanoa ignores an input while its quality is bad, so they can't unmount or block
anything.

Injection Press 1's mode card shows *No mode selected* for now. That's expected: it hasn't run yet, and there's no mold
to mount. You'll put it into **Changeover** when you mount its first mold in [Run and Change Over](3-run-and-change-over.md).

:::check

Copy this script into the Ignition Designer Script Console (**Tools → Script Console**) and run it. It checks that
`Injection Press 1` is OEE-enabled in the Molding area and uses tooling, that it has rates for `EC-25` and `EC-32`, that
the Injection Press 1 simulator tags were imported, and that its `Line` and `Tooling` tags have the right **MQTT path**.
Each check prints PASS or FAIL with what to fix. It doesn't change anything.

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

::check-script{src="ops/12-tooling/1-a-new-press.py" title="checkLesson-aNewPress.py"}

</details>

:::
