# Kanoa Tags

Kanoa MES uses two tag providers:

| Provider | Type | What it holds |
|---|---|---|
| `Kanoa` | Standard, created by you | The tags Kanoa runs on: one folder per asset with its assetOEE, counter and measure UDT instances, the `kanoa` system folder (timers and debug flags), and the Kanoa tag UDT definitions |
| `kanoaMES` | Managed, created by the module | Read-only installation and license information |

## The Kanoa tag provider

### Setting it up

The `Kanoa` provider is a standard Ignition tag provider that you create once, before installing or starting the `kanoaAPP` module. See [Configure the Tag Provider](../getting-started/installation/configure-tags.md) for the steps. In short:

- **Type:** Standard
- **Mode:** Realtime
- **Name:** `Kanoa`. The name is required: the UDTs and Kanoa scripts expect it.

Whenever the module is installed or restarted, Kanoa installs or updates the `kanoa` system folder and the Kanoa UDT definitions under `_types_/Kanoa`. Your own tags in the provider are left alone.

In scripts, get the provider name from [`system.kanoa.config.getTagProvider()`](../systemFunctions/config/getTagProvider.md) rather than hard-coding `[Kanoa]`:

```python
mesTagProvider = system.kanoa.config.getTagProvider('mes')	# '[Kanoa]'
debug = system.tag.readBlocking([mesTagProvider + 'kanoa/debug/tags/debugStates'])[0].value
```

:::warning[Updates overwrite the Kanoa UDTs]
Don't edit the UDT definitions under `_types_/Kanoa`, or the tags in the `kanoa` folder, directly. A module update replaces them. To change behavior, override the instance (for example a tag change script on one asset's tag), or create your own UDT that inherits from the Kanoa one.
:::

### What's in it

```text
[Kanoa]
├── <Enterprise>/<Site>/<Area>/<Line>     one folder per OEE Enabled asset
│   ├── Line                              assetOEE UDT instance
│   ├── counters/<counter name>           counter UDT instances (Counters tab, Tag ticked)
│   └── measures/<measure name>           measure UDT instances (Measures, Tag ticked)
├── kanoa
│   ├── timers                            tagTimer instances that run Kanoa's background jobs
│   ├── debug                             logging switches
│   ├── qds/config                        Kanoa Quality settings
│   └── marquees                          marquee refresh timestamp
└── _types_
    ├── Kanoa                             Kanoa tag UDT definitions
    └── assetSimulator                    simple asset simulator UDT
```

Other folders you see, such as `CoreForge Sim` or `erpSim` on a training gateway, are your own tags. Kanoa doesn't manage them.

### Asset folders

When you tick **OEE Enabled** on an asset, Kanoa creates a folder that mirrors the asset's path, with an [assetOEE](#assetoee) instance named `Line` inside it. For example, `CoreForge\Philadelphia\Machining\Machine 1` becomes:

```text
[Kanoa]CoreForge/Philadelphia/Machining/Machine 1/Line
```

Counters and measures created with **Tag** ticked are added next to it, in `counters` and `measures` folders. Use `system.kanoa.asset.getAssetTagPath({'assetPath': ...})` to get an asset's folder from its path.

### The kanoa folder

#### Timers

Each tag in `kanoa/timers` is a [tagTimer](#tagtimer) instance that runs one of Kanoa's background jobs. Don't disable them unless Kanoa support asks you to. Several features stop updating without them.

| Timer | Default interval | What it does |
|---|---|---|
| `updateAssetOEETimer` | 60 s | Writes the current run's mode, order, item, counts and OEE into each asset's `Line/OEE` folder |
| `updateAssetShiftTimer` | 60 s | Writes each asset's current shift into its `Line/OEE` folder |
| `getAssetShiftOEETimer` | 60 s | Gets OEE by shift for the last day for each asset |
| `checkAssetScheduleTimer` | 60 s | Checks the schedule to see whether an asset's mode should change, for scheduled runs |
| `getActiveAssetScheduleTimer` | 60 s | Refreshes the active asset schedule |
| `getActiveOrdersTimer` | 60 s | Refreshes the list of active production orders |
| `shiftEventTimer` | 3600 s | Adds upcoming entries to the shift event table |
| `checkForDuplicateEvents` | 360 s | Checks the mode event table for duplicate entries |
| `checkZeroCounts` | 300 s | Deletes counter events with a zero value that are more than 60 minutes old |
| `qdsIntervalTimer` | 60 s | Kanoa Quality: checks whether any interval-based quality checks are due |
| `qdsScheduleChecks` | 60 s | Kanoa Quality: stores the actively scheduled quality checks |
| `checkCMMSSchedule` | 60 s | Kanoa Maintenance: checks work order schedules and conditions |

Each timer's `lastUpdated`, `error` and `data` tags show when it last ran and what happened. Set its `debug` tag to `true` to log how long each run takes.

#### Debug

Set a flag in `kanoa/debug/tags` to `true` to write detailed logs for that area to the Gateway console. Set it back to `false` when you're done: debug logging is verbose.

| Tag | Logs |
|---|---|
| `debugAssets` | Asset functions |
| `debugCounts` | Count events |
| `debugDashboards` | Dashboards |
| `debugDTAnalysis` | Downtime analysis |
| `debugFlag` | State changes from the assetOEE `State` tag |
| `debugLots` | Lot functions |
| `debugModes` | Mode changes |
| `debugOrders` | Production orders |
| `debugQuality` | Quality functions |
| `debugQualityChecks` | Quality check scheduling |
| `debugScheduler` | The scheduler |
| `debugShifts` | Shifts |
| `debugSimulator` | The asset simulator |
| `debugStates` | State functions |
| `debugUsers` | Users and security |

`kanoa/debug/LoggerName` sets the logger name (default `Kanoa`), so you can filter the Gateway logs on it.

#### Other settings

| Tag | Purpose |
|---|---|
| `kanoa/qds/config/enableDivisionLimits` | Kanoa Quality: turns on the division limits (`ldl`, `udl`) in attribute tolerances |
| `kanoa/marquees/lastUpdated` | When the marquee data was last refreshed |

## The kanoaMES tag provider

`kanoaMES` is a managed tag provider that the module creates and keeps up to date. It's read-only: you don't create or edit anything in it. Use it to check what's installed and licensed, from a screen or a script.

### installationInfo

| Tag | Example | Meaning |
|---|---|---|
| `kanoaMESVersion` | `1.15.9-beta1` | Installed Kanoa MES version, including any `-beta` or `-rc` suffix |
| `previouslyInstalledVersion` | `Reinstalling 1.15.9` | The version that was installed before this one |
| `installationDate` | `2026-10-04T21:04:01` | When this version was installed |
| `hawthornStatus` | `Hawthorn Success` | Result of the database update the installer ran |
| `ignitionVersion` | `8.1.54` | Ignition version |
| `ignitionSystemName` | `Ignition-gateway` | Gateway system name |
| `systemTimeZone` | `Etc/UTC` | Gateway time zone |
| `dbProduct`, `dbVersion` | `Microsoft SQL Server`, `16.00.4255` | The Kanoa database server |
| `driverName`, `driverVersion` | `Microsoft JDBC Driver 9.4 for SQL Server`, `9.4.0.0` | The JDBC driver in use |

### licenseInfo

Two flags per product: `<product>Licensed` means a license is installed, and `<product>Active` means the product is running (licensed or in trial).

| Product | Tags |
|---|---|
| Kanoa Ops | `opsLicensed`, `opsActive` |
| Kanoa Quality | `qdsLicensed`, `qdsActive` |
| Kanoa Trace | `traceLicensed`, `traceActive` |
| Kanoa Maintenance | `cmmsLicensed`, `cmmsActive` |
| Kanoa Inventory | `invLicensed`, `invActive` |
| Trial | `trialActive` |

```python
qv = system.tag.readBlocking(['[kanoaMES]licenseInfo/opsActive', '[kanoaMES]installationInfo/kanoaMESVersion'])
print 'Ops active:', qv[0].value, 'version:', qv[1].value
```

## Kanoa tag UDTs

The UDT definitions live in `[Kanoa]_types_/Kanoa`. Most are created for you by Kanoa configuration screens; a few (the lot and quality trigger UDTs) you add yourself where you need them.

| UDT | Created by | Use it for |
|---|---|---|
| [assetOEE](#assetoee) | Kanoa, when an asset is OEE Enabled | The interface between equipment data and Kanoa Ops |
| [assetInputs](#assetinputs) | You | A staging area for an asset's inputs, read by assetOEE through its MQTT path |
| [counters/counter](#counterscounter) | Kanoa, from the Counters tab | Extra infeed, outfeed, waste and general counters |
| [measure](#measure) | Kanoa, from the Measures screen | Collecting and summarizing a process value |
| [tagTimer](#tagtimer) | Kanoa (`kanoa/timers`), or you | Running a script on an interval |
| [timer](#timer) | You | A simple once-a-minute script trigger |
| [qds/chkShtTrigger](#qdschkshttrigger) | You | Starting a check sheet from a tag change |
| [qds/chkEvents](#qdschkevents) | You | A live list of due and recent check sheet events |
| [lotTracker](#lottracker) | You | Recording a lot operation when a lot name is scanned or written |
| [lotOperationManager](#lotoperationmanager) | You | Starting a lot operation event from a tag |
| [lotAccumulator](#lotaccumulator) | You | Building an output lot from a count |
| [lotQueueFIFO](#lotqueuefifo) | You | Consuming input lots first-in, first-out from a count |
| [counter, generalCounter](#older-counter-udts) | Older versions | Kept for existing instances |

### assetOEE

One instance, named `Line`, per OEE Enabled asset. It receives the equipment's state, counts and production context, turns changes into Kanoa events, and holds live OEE values for screens and dashboards. Its one parameter, `MQTTPath`, links all its inputs to a source structure such as an [assetInputs](#assetinputs) instance.

See [Data Interface Tag](../kanoa-ops/assets/assetOEEInfo.md) for every folder and tag, how to connect it, and what Kanoa does when each input changes.

### assetInputs

A staging UDT with the same `Inputs` tags as assetOEE, all memory or expression tags. Use it where you calculate or combine values before Kanoa records them (for example, deriving outfeed from two sensors), then point the assetOEE `MQTTPath` at it. The definition's default expressions read Ignition's Generic Simulator, so override them on each instance.

### counters/counter

Created under `<asset>/counters/<counter name>` when you add a counter with **Tag** ticked on the [Counters tab](../kanoa-ops/assets/counters.md).

| Tag | Purpose |
|---|---|
| `countValue` | Reference tag. Point it at your count source. Each change is recorded as a counter event, with resets handled as for assetOEE |
| `counterType` | `infeed`, `outfeed`, `waste` or `general` |
| `counterId`, `assetId` | Set on startup from the tag's folder and name, creating the counter if needed |
| `itemId`, `itemStateId`, `workOrderId` | Optional. Written with each count, for example an `itemStateId` to record waste against a reason |
| `update` | Set to `true` to look up `assetId` and `counterId` again |

### measure

Created under `<asset>/measures/<measure name>` when you tick **Tag** on a measure. See [Measures](../kanoa-ops/measures.md) for the full reference.

| Tag | Purpose |
|---|---|
| `measureValue` | Point it at the value to measure. Each change is added to `data` while `enabled` is `true` |
| `enabled` | Starts and stops collecting |
| `maxSampleCount`, `maxSampleDurationSecs` | When the window is full by either count or time, `update` fires and one record (mean, min, max, standard deviation, sample count, duration) is written to the database |
| `data` | The samples collected so far. Cleared after each record |
| `spcCheckEnabled` | Runs SPC rules (individuals chart, Western Electric and Nelson) on the window as samples arrive |
| `outOfControl`, `ruleViolations` | The result of the SPC check |
| `spec` | The linked attribute's limits for this asset and the item running. Set `spec/refresh` to `true` to reload them; it also reloads when the item changes |
| `measureId`, `lastUpdated`, `error`, `debug` | Housekeeping |

### tagTimer

The timer behind every tag in `kanoa/timers`, and a good base for your own interval jobs.

| Tag | Purpose |
|---|---|
| `enable` | Turns the timer on or off |
| `intervalSecs` | How often it runs (default 60) |
| `update` | Set to `true` when the timer fires. The instance's `update` script does the work, then resets it. Write `true` to run it now |
| `lastUpdated`, `error` | When it last ran, and the error if it failed |
| `description`, `data`, `debug` | A note on what it does, a dataset for results, and logging of each run's duration |

To make your own, create an instance, override the `update` tag's change script with your work in place of the `pass` line, and set `enable` and `intervalSecs`.

### timer

A simpler timer that sets `update` once a minute while `enabled` is `true`. Override the `update` script the same way as tagTimer.

### qds/chkShtTrigger

Starts a Kanoa Quality check sheet from a tag. Place the instance in an asset's folder, next to `Line`. Set `chkShtVersionGroupId` to the check sheet, then either set `trigger` to `true` or point `referenceTag` at a tag whose change should start it (at most once every `intervalSecs`). The released version of the check sheet is started for the asset, with its current item and shift.

### qds/chkEvents

Keeps `chkEventData` filled with check sheets that are Due, Overdue or Coming Due, plus those completed in the last day. It refreshes once a minute, or when `updateChkEventData` is set to `true`. Useful as a data source for a quality screen.

### lotTracker

Place it in an asset's folder, next to `Line`. Set `lotOperationName`, then write a lot name to `lotName` (for example from a scanner). Kanoa records the lot operation on the asset, creating the lot for the running item if it doesn't exist. `message` shows `success` or the reason it failed.

### lotOperationManager

**Parameters:** `assetId`, `lotOperationName`. Changing `setupLotOperation` starts a new lot operation event for the asset and writes its ID to `lotOperationEventId`, for lotAccumulator and lotQueueFIFO instances to use.

### lotAccumulator

Builds an output lot from a count. **Parameters:** `assetPath` (the asset's tag folder), `lotOperationPath` (a lotOperationManager instance), `countOnIncrease`, `alwaysMakeNewOutputLot`. Point `sourceTag` at a count and set `enabled` to `true`. Each increase is added to the output lot for the current lot operation event, which is created from `outputLotInfo` (item, units, a lot name root numbered `-001`, `-002` and so on) and `outputLotEventInfo` (state, reason, order, shift).

### lotQueueFIFO

Consumes input lots in first-in, first-out order from a count. **Parameters:** `inputAssetId`, `assetPath`, `lotOperationPath`, `countOnIncrease`. Each increase of `sourceTag` is drawn from the oldest lots with quantity on the input asset, moving to the next lot when one runs out. `inputLotEventFilter` limits which lots are used by state and reason.

### Older counter UDTs

`counter` and `generalCounter` in `_types_/Kanoa` are earlier counter UDTs, kept so existing instances keep working. Use [counters/counter](#counterscounter) for new counters.

### assetSimulator

`[Kanoa]_types_/assetSimulator` generates simple states and counts for an asset without equipment. See [Simulator](./simulator.md).
