# MTConnect
Polls machine tools that expose an **MTConnect agent** — the read-only HTTP/XML
standard common on CNC machines. Every poll cycle fetches the agent's `current`
document once and extracts all addressed observations, so any number of items costs
a single HTTP request per cycle.
| | |
|---|---|
| Connection string | `mtconnect.http://HOST[:PORT][/PATH]` — `PATH` may carry a device name to restrict a multi-device agent |
| Reads | ✔ (poll) |
| Writes | — |
| Subscriptions | — |
| Browsing | ✔ (data items of the probe document) |
## Device options
| Key | Type | Default | Meaning |
|---|---|---|---|
| `https` | boolean | `false` | Connect via `https://`. |
| `timeout` | int | `5000` | HTTP connect/response timeout in ms. |
| `reportUnavailable` | boolean | `false` | Forward `UNAVAILABLE` observations as String values. By default they are skipped so the value type of an item stays stable. |
## Address format
The `dataItemId` of the observation (see the probe document or the address
browser). If no observation with that id exists, the `name` attribute is matched as
a fallback.
- Numeric observations become Numbers, everything else Strings.
- Condition observations report their state (`Normal`, `Warning`, `Fault`).
- The published value carries the **observation timestamp** of the agent, not the
poll time.
## Example configuration
The public MTConnect demo agent can be used directly:
```json
{
"devices": [
{
"objectId": "mazak1",
"name": "Mazak Demo",
"connectionString": "mtconnect.http://agent.mtconnect.org",
"interval": 5000,
"enabled": true,
"options": { "https": false, "timeout": 5000 },
"extraOptions": { "host": "broker:1883", "clientId": "openconnect" }
}
],
"items": [
{
"objectId": "spindle",
"DeviceID": { "objectId": "mazak1" },
"address": "S2speed",
"label": "Spindle speed",
"type": "Number",
"unit": "rpm",
"source": { "tag": "demo/mazak" },
"enabled": true,
"onChange": true,
"extraOptions": {}
},
{
"objectId": "mode",
"DeviceID": { "objectId": "mazak1" },
"address": "cn2mode",
"label": "Controller mode",
"type": "String",
"unit": "",
"source": { "tag": "demo/mazak" },
"enabled": true,
"onChange": true,
"extraOptions": {}
}
]
}
```
## Browsing
The address browser (management UI) lists all `DataItem` elements of the probe
document with type, category, and units; SAMPLE items are suggested as Number,
EVENT/CONDITION items as String.