> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreflux.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Allen-Bradley Connector

> Connect to Rockwell Automation PLCs over EtherNet/IP with symbolic tag names, program scope, UDTs, arrays, and bidirectional writes.

## Connect to Rockwell PLCs by Tag Name

The `ALLEN_BRADLEY` connector connects Coreflux to Rockwell Automation PLCs using **symbolic tag names** over EtherNet/IP. Define an `ALLEN_BRADLEY_CONFIG` block, add TAGs with PLC tag addresses, and publish each data point to its own MQTT topic — with optional scaling, units, deadband, and bidirectional writes.

> [!TIP]
>
> **Like reading labels on a control panel.** Instead of numeric register addresses, you use the same tag names you see in Studio 5000 — `MainCounter`, `Program:MainProgram.Temperature`, `Motor1.Speed`.

> [!NOTE]
>
> For **explicit CIP paths** (`4.100.3.0`), use the [EtherNet/IP connector](https://docs.coreflux.org/v2.22/lot-language/routes/industrial/ethernetip.md) instead. This connector is for symbolic tag-name access; EtherNet/IP is for Class/Instance/Attribute addressing.

### Connector and config aliases

| Alias | Canonical form |
| - | - |
| `TYPE AB` or `TYPE ALLENBRADLEY` | `TYPE ALLEN_BRADLEY` |
| `ADD AB_CONFIG` | `ADD ALLEN_BRADLEY_CONFIG` |

### Key capabilities

* **Symbolic tag names** — controller-scoped, program-scoped, UDT members, and arrays
* **Multiple PLC families** — ControlLogix, CompactLogix, Micro800, MicroLogix, PLC5, SLC500
* **TAG-based polling** — per-point MQTT topics with configurable intervals
* **Bidirectional writes** — `WRITABLE` tags with `DESTINATION_TOPIC`
* **Engineering units** — `SCALING`, `OFFSET`, `UNIT`, `DECIMAL_PLACES`, min/max clamping
* **Publish modes** — `VALUE_ONLY` (default) or `JSON` with quality metadata

***

## Quick Start

> [tab] Poll a controller tag
>
> Read a controller-scoped DINT counter every second:
>
> ```lot wrap focus={9-13} theme={"theme":{"light":"css-variables","dark":"css-variables"},"languages":{"custom":["/languages/lot.json"]}}
> DEFINE CONNECTOR ControlLogixPLC WITH TYPE ALLEN_BRADLEY
>     ADD ALLEN_BRADLEY_CONFIG
>         WITH IP "192.168.1.10"
>         WITH DEVICE_FAMILY 0
>         WITH PATH "1,0"
>     ADD MAPPING ProductionData
>         WITH EVERY 1 SECOND
>         ADD TAG ProductCounter
>             WITH ADDRESS "MainCounter"
>             WITH DATA_TYPE "DINT"
>             WITH SOURCE_TOPIC "production/counter"
> ```

> [tab] Program-scoped tags
>
> Read tags inside a specific program with units and deadband:
>
> ```lot wrap focus={9-16} theme={"theme":{"light":"css-variables","dark":"css-variables"},"languages":{"custom":["/languages/lot.json"]}}
> DEFINE CONNECTOR ControlLogix WITH TYPE ALLEN_BRADLEY
>     ADD ALLEN_BRADLEY_CONFIG
>         WITH IP "192.168.1.20"
>         WITH DEVICE_FAMILY 0
>     ADD MAPPING ProcessControl
>         WITH EVERY 500 MILLISECONDS
>         ADD TAG ReactorTemp
>             WITH ADDRESS "Program:MainProgram.Temperature"
>             WITH DATA_TYPE "REAL"
>             WITH UNIT "°C"
>             WITH DECIMAL_PLACES 2
>             WITH DEADBAND 0.5
>             WITH SOURCE_TOPIC "process/reactor/temperature"
> ```

> [tab] Read and write
>
> Poll a setpoint and accept MQTT writes to update it:
>
> ```lot wrap focus={9-18} theme={"theme":{"light":"css-variables","dark":"css-variables"},"languages":{"custom":["/languages/lot.json"]}}
> DEFINE CONNECTOR TemperatureControl WITH TYPE ALLEN_BRADLEY
>     ADD ALLEN_BRADLEY_CONFIG
>         WITH IP "192.168.1.60"
>         WITH DEVICE_FAMILY 0
>     ADD MAPPING ControlLoop
>         WITH EVERY 1 SECOND
>         ADD TAG TempSetpoint
>             WITH ADDRESS "TempSetpoint"
>             WITH DATA_TYPE "REAL"
>             WITH UNIT "°C"
>             WITH MIN_VALUE 0.0
>             WITH MAX_VALUE 100.0
>             WITH SOURCE_TOPIC "control/temperature/setpoint"
>             WITH WRITABLE "true"
>             WITH DESTINATION_TOPIC "control/temperature/setpoint/write"
> ```

> [tab] Micro800
>
> Read built-in I/O on a Micro800 controller:
>
> ```lot wrap focus={9-14} theme={"theme":{"light":"css-variables","dark":"css-variables"},"languages":{"custom":["/languages/lot.json"]}}
> DEFINE CONNECTOR Micro800PLC WITH TYPE ALLEN_BRADLEY
>     ADD ALLEN_BRADLEY_CONFIG
>         WITH IP "192.168.1.70"
>         WITH DEVICE_FAMILY 4
>     ADD MAPPING Micro800Data
>         WITH EVERY 1 SECOND
>         ADD TAG DigitalIn
>             WITH ADDRESS "_IO_EM_DI_00"
>             WITH DATA_TYPE "BOOL"
>             WITH SOURCE_TOPIC "micro800/input0"
> ```

***

## Connection Configuration

### ALLEN\_BRADLEY\_CONFIG Parameters

| Parameter | Required | Default | Description |
| - | - | - | - |
| `IP` | Yes | — | PLC IP address |
| `DEVICE_FAMILY` | No | `0` | Device family code (0–6, see table below) |
| `PORT` | No | `44818` | EtherNet/IP port. Honored for every device family. Default is `44818`. |
| `SLOT` | No | `0` | Parsed for legacy parity only. Backplane routing uses **`PATH`, not `SLOT`** — set the CPU slot in `PATH` (for example `"1,0"`). |
| `PATH` | No | `"1,0"` | Routing path (`backplane,slot`) for families that use a backplane. Micro800 (`DEVICE_FAMILY 4`) has no backplane: omit `PATH`. If you set one, the broker ignores it and logs a warning. |
| `TIMEOUT` | No | `5000` | Per-tag read/write timeout in milliseconds. Default is `5000`. Minimum accepted value is `1000`; values below that fail route add validation. |

> [!NOTE]
>
> The config block may be declared as `ADD ALLEN_BRADLEY_CONFIG` or `ADD AB_CONFIG` — both are equivalent.

> [!NOTE]
>
> The connector reports **Connected** only after the PLC answers. With at least one tag, it opens one tag using the same settings a read uses. With no tags, it checks the EtherNet/IP session. If the controller later drops, the route moves to **Reconnecting** and recovers on its own.
>
> Each read or write opens the tag and then reads or writes it, and each step has its own `TIMEOUT`. The route waits 2 × `TIMEOUT` plus a margin, at least 1 s, before it gives up. That's about 5 s at `TIMEOUT 2000`. So a dead PLC is detected later than `TIMEOUT` alone suggests, and the first read after a reconnect can take up to twice as long. A write that times out publishes `"success": false` with `"outcome": "unknown"`, because the PLC may still apply it. See [Write results](https://docs.coreflux.org/v2.22/lot-language/routes/industrial/overview.md#write-results). Publish `-checkConnectorConnection <name>` to `$SYS/Coreflux/Command` to run that same test.

### Device Family Codes

| Code | Family | Use when |
| - | - | - |
| `0` | ControlLogix / CompactLogix | 1756-L6x, L7x, L8x, 1769-Lxx (most common) |
| `1` | PLC5 | 1785-L series (legacy) |
| `2` | SLC500 | 1747-L series (legacy) |
| `3` | ControlLogix PLC5 | Mixed environment |
| `4` | Micro800 | 2080-LC series |
| `5` | MicroLogix | 1766, 1764 series |
| `6` | Omron | NJ/NX with CIP support |

### Connection Examples

> [tab] ControlLogix / CompactLogix
>
> Standard backplane path to CPU in slot 0:
>
> ```lot wrap theme={"theme":{"light":"css-variables","dark":"css-variables"},"languages":{"custom":["/languages/lot.json"]}}
> ADD ALLEN_BRADLEY_CONFIG
>     WITH IP "192.168.1.100"
>     WITH DEVICE_FAMILY 0
>     WITH PATH "1,0"
>     WITH TIMEOUT 5000
> ```

> [tab] MicroLogix
>
> MicroLogix 1100/1400:
>
> ```lot wrap theme={"theme":{"light":"css-variables","dark":"css-variables"},"languages":{"custom":["/languages/lot.json"]}}
> ADD ALLEN_BRADLEY_CONFIG
>     WITH IP "192.168.1.50"
>     WITH DEVICE_FAMILY 5
>     WITH TIMEOUT 5000
> ```

> [tab] Through backplane
>
> CPU in slot 2 on backplane 1:
>
> ```lot wrap theme={"theme":{"light":"css-variables","dark":"css-variables"},"languages":{"custom":["/languages/lot.json"]}}
> ADD ALLEN_BRADLEY_CONFIG
>     WITH IP "192.168.1.100"
>     WITH DEVICE_FAMILY 0
>     WITH PATH "1,2"
>     WITH TIMEOUT 5000
> ```

> [tab] Micro800
>
> Micro800 has no backplane, so omit `PATH`. A `PATH` on this family is ignored and logged as a warning:
>
> ```lot wrap theme={"theme":{"light":"css-variables","dark":"css-variables"},"languages":{"custom":["/languages/lot.json"]}}
> ADD ALLEN_BRADLEY_CONFIG
>     WITH IP "192.168.1.70"
>     WITH DEVICE_FAMILY 4
>     WITH TIMEOUT 5000
> ```

***

## Tag Addressing

Allen-Bradley PLCs use **tag-based addressing** (not register numbers). Tag names are case-sensitive.

| Scope | Format | Example |
| - | - | - |
| Controller | `TagName` | `MainCounter` |
| Program | `Program:ProgramName.TagName` | `Program:MainProgram.Counter` |
| Array element | `TagName[index]` | `Temps[5]` |
| UDT member | `UDTInstance.Member` | `Valve1.Status` |
| Nested UDT | `Parent.Child.GrandChild` | `Tank1.Level.Current` |
| I/O tags | `Local:Slot:Type.Data[index]` | `Local:1:I.Data[0]` |

### Tag naming rules

* Letters, numbers, and underscore only
* Must start with a letter or underscore
* Case-sensitive
* No spaces

```lot wrap theme={"theme":{"light":"css-variables","dark":"css-variables"},"languages":{"custom":["/languages/lot.json"]}}
# Valid
WITH ADDRESS "MainCounter"
WITH ADDRESS "Program:MainProgram.Temperature"
WITH ADDRESS "Valve1.Status"
WITH ADDRESS "Temps[5]"
```

***

## Data Types

| Coreflux `DATA_TYPE` | AB type | Notes |
| - | - | - |
| `BOOL` | BOOL | Boolean |
| `SINT` | SINT | Signed 8-bit |
| `USINT` / `BYTE` | USINT | Unsigned 8-bit |
| `INT` | INT | Signed 16-bit |
| `UINT` / `WORD` | UINT | Unsigned 16-bit |
| `DINT` | DINT | Signed 32-bit |
| `UDINT` / `DWORD` | UDINT | Unsigned 32-bit |
| `LINT` | LINT | Signed 64-bit |
| `ULINT` / `LWORD` | ULINT | Unsigned 64-bit |
| `REAL` / `FLOAT` | REAL | 32-bit float |
| `LREAL` / `DOUBLE` | LREAL | 64-bit float — MQTT values round to `DECIMAL_PLACES` (default `2`) |
| `CHAR` | CHAR | Single character |
| `WCHAR` | WCHAR | Published as the character |
| `STRING` | STRING | CIP string with a length prefix — see [STRING encoding](#string-encoding) |
| `TIME` | TIME | Duration in ms — published as `T#XdXhXmXsXms` |
| `DATE` | DATE | Published as `yyyy-MM-dd` (the PLC stores seconds since 1970) |
| `TOD` | TOD | Published as `hh:mm:ss.fff` |

> [!NOTE]
>
> `DATE`, `TOD`, and `WCHAR` publish in these forms on every Allen-Bradley family. Measured on a Micro850: `1790553600` seconds publishes `2026-09-28`, and `65535` ms publishes `00:01:05.535`. Connected Components Workbench has no creatable `CHAR`, `WCHAR`, or `TOD` variable on Micro800, so those types apply to Logix families.

> [!WARNING]
>
> A tag's `DATA_TYPE` must match the PLC tag's actual type. On a mismatch the tag is refused: no value is published, the tag goes BAD, and the log names both types. Route health leaves Green and goes Yellow. The check is strict. A PLC `INT` declared as `DINT` is refused too. That case used to read correctly by luck.

### STRING encoding

Writes include the CIP length prefix. The layout depends on `DEVICE_FAMILY`.

* **ControlLogix / CompactLogix (default):** fixed 88-byte CIP `STRING` — a 4-byte DINT length prefix plus up to 82 ASCII characters. Neither `LENGTH` nor `STRING_SIZE` resizes this layout. `STRING_SIZE` is accepted as an alias for the same field and has the same limitation.
* **Micro800:** a 1-byte length prefix plus the characters. A write can be longer than the value currently stored in the tag. The broker sizes the tag so the new string fits, up to the String Size configured for that tag in Connected Components Workbench (for example, 80 characters). A longer string is rejected with an error instead of being truncated.

### TIME encoding

Raw value is a signed 32-bit millisecond count. MQTT publishes Allen-Bradley-style duration strings (for example `T#1h1m1s1ms`).

### Write value formats

Publish a payload to `DESTINATION_TOPIC` on a tag with `WRITABLE "true"`. Multi-byte values are written little-endian, the byte order CIP expects.

| `DATA_TYPE` | Accepted write value | Example |
| - | - | - |
| `WORD`, `DWORD`, `LWORD` | Decimal, the same form a read publishes, or hex with a `16#` or `0x` prefix | `500` or `16#01F4` |
| `TIME` | A `T#` duration, or a millisecond count. `T#10s` writes 10000 ms | `T#10s` |
| `DATE` | An ISO date `yyyy-MM-dd`, written as seconds since 1970-01-01 UTC | `2025-01-01` |
| `TOD` | Milliseconds since midnight. A read publishes `hh:mm:ss.fff`; a write does not accept that string | `65535` |
| `STRING` | The characters to store. The broker sends the CIP length prefix. On Micro800, see [STRING encoding](#string-encoding) for the String Size limit | `Pump-01` |

An on-demand `ADD EVENT` write accepts `T#` durations and sends the `STRING` length prefix. For `WORD`, `DWORD`, `LWORD`, and `DATE`, put the decimal or seconds form in the event `value` field. The `16#` / `0x` and `yyyy-MM-dd` forms apply to writable-tag payloads.

***

## TAG Configuration

Every polled data point is an `ADD TAG` inside an `ADD MAPPING` block.

### Complete TAG Example

```lot wrap theme={"theme":{"light":"css-variables","dark":"css-variables"},"languages":{"custom":["/languages/lot.json"]}}
ADD TAG MotorSpeed
    WITH ADDRESS "Motor1.ActualSpeed"
    WITH ADDRESS_TYPE "SYMBOL"
    WITH DATA_TYPE "REAL"
    WITH SOURCE_TOPIC "plc/motor1/speed"
    WITH SCALING 1
    WITH OFFSET 0
    WITH UNIT "RPM"
    WITH DECIMAL_PLACES 2
    WITH MIN_VALUE 0
    WITH MAX_VALUE 3600
    WITH DEADBAND 10
    WITH PUBLISH_MODE "JSON"
    WITH DESCRIPTION "Motor 1 actual speed in RPM"
```

### TAG Parameters

> [accordion] Address and data type
>
> **ADDRESS** `string` *required*
>
> PLC tag name — controller-scoped (`MainCounter`), program-scoped (`Program:MainProgram.Counter`), UDT member (`Valve1.Status`), or array (`Temps[0]`).
>
> **ADDRESS\_TYPE** `string`
>
> `SYMBOL` (default) or `PATH`.
>
> **DATA\_TYPE** `string` *required*
>
> Logix data type: `BOOL`, `SINT`, `INT`, `DINT`, `LINT`, `USINT`, `UINT`, `UDINT`, `ULINT`, `REAL`, `LREAL`, `STRING`, `TIME`, etc. It must match the PLC tag's actual type. A mismatch publishes no value, marks the tag BAD, and route health goes Yellow. See [Data Types](#data-types).

> [accordion] Value transformation
>
> **SCALING** `decimal`
>
> Multiply the parsed value after read. Alias: `SCALING_FACTOR`. Default: `1.0`.
>
> **OFFSET** `decimal`
>
> Add after scaling. Default: `0.0`.
>
> **UNIT** `string`
>
> Engineering unit (for example `°C`, `bar`, `RPM`). Included in JSON publish mode.
>
> **DECIMAL\_PLACES** `integer`
>
> Rounding precision for float MQTT payloads. Default: `2`.

> [accordion] Filtering
>
> **MIN\_VALUE** `double`
>
> Clamp minimum allowed value (especially for writable tags).
>
> **MAX\_VALUE** `double`
>
> Clamp maximum allowed value.
>
> **DEADBAND** `double`
>
> Suppress MQTT publish when the change is below this threshold. Default: `0.0`.

> [accordion] Publishing and writes
>
> **SOURCE\_TOPIC** `string` *required*
>
> MQTT topic where polled values are published.
>
> **PUBLISH\_MODE** `string`
>
> `VALUE_ONLY` (default) or `JSON` (value, unit, quality, timestamp, description).
>
> **WRITABLE** `boolean`
>
> When `"true"`, subscribe to `DESTINATION_TOPIC` and write incoming MQTT values to the PLC.
>
> **DESTINATION\_TOPIC** `string`
>
> MQTT topic to receive write commands. Required when `WRITABLE` is `"true"`.
>
> **DESCRIPTION** `string`
>
> Human-readable description (included in JSON publish mode).

### Publish Modes

**VALUE\_ONLY** (default) — publishes just the scaled value:

```
12345
```

**JSON** — metadata wrapper when explicitly set:

```json wrap theme={"theme":{"light":"css-variables","dark":"css-variables"},"languages":{"custom":["/languages/lot.json"]}}
{
  "tag_name": "SafetyPressure",
  "value": 8.456,
  "unit": "bar",
  "quality": "GOOD",
  "timestamp": "2025-12-17T10:30:45.123Z",
  "description": "Critical safety pressure sensor"
}
```

***

## Event-Based Operations

For on-demand tag reads and writes (not continuous polling), add an `ADD EVENT` block. Publish any message to `SOURCE_TOPIC` to trigger the operation; results appear on `DESTINATION_TOPIC`.

### Query Parameters

| Parameter | Description | Example |
| - | - | - |
| `operation` | `READ` or `WRITE` | `READ` |
| `variable` | PLC tag name | `Program:MainProgram.Counter`, `MainCounter` |
| `data_type` | Logix data type | `DINT`, `REAL`, `BOOL` |
| `value` | Value to write (WRITE only) | `42`, `75.0` |

### Read Example

```lot wrap theme={"theme":{"light":"css-variables","dark":"css-variables"},"languages":{"custom":["/languages/lot.json"]}}
ADD EVENT ReadOnDemand
    WITH SOURCE_TOPIC "ab/commands/read"
    WITH DESTINATION_TOPIC "ab/responses/read"
    WITH QUERY "{operation: READ, variable: Program:MainProgram.Counter, data_type: DINT}"
```

### Write Example

```lot wrap theme={"theme":{"light":"css-variables","dark":"css-variables"},"languages":{"custom":["/languages/lot.json"]}}
ADD EVENT WriteSetpoint
    WITH SOURCE_TOPIC "ab/commands/write"
    WITH DESTINATION_TOPIC "ab/responses/write"
    WITH QUERY "{operation: WRITE, variable: TIC100.SP, data_type: REAL, value: 150.0}"
```

***

## Examples

> [tab] Multiple data types
>
> Monitor BOOL, DINT, and REAL tags in one mapping:
>
> ```lot wrap theme={"theme":{"light":"css-variables","dark":"css-variables"},"languages":{"custom":["/languages/lot.json"]}}
> DEFINE CONNECTOR ProductionLine WITH TYPE ALLEN_BRADLEY
>     ADD ALLEN_BRADLEY_CONFIG
>         WITH IP "192.168.1.30"
>         WITH DEVICE_FAMILY 0
>     ADD MAPPING MachineMonitor
>         WITH EVERY 1 SECOND
>         ADD TAG MachineRunning
>             WITH ADDRESS "MachineStatus.Running"
>             WITH DATA_TYPE "BOOL"
>             WITH SOURCE_TOPIC "machine/status/running"
>         ADD TAG ProductCount
>             WITH ADDRESS "ProductionCounters.TotalCount"
>             WITH DATA_TYPE "DINT"
>             WITH SOURCE_TOPIC "machine/production/total"
>         ADD TAG LineSpeed
>             WITH ADDRESS "LineSpeed"
>             WITH DATA_TYPE "REAL"
>             WITH UNIT "units/min"
>             WITH SOURCE_TOPIC "machine/speed"
> ```

> [tab] UDT members
>
> Read User-Defined Type structure members:
>
> ```lot wrap theme={"theme":{"light":"css-variables","dark":"css-variables"},"languages":{"custom":["/languages/lot.json"]}}
> DEFINE CONNECTOR UDTAccess WITH TYPE ALLEN_BRADLEY
>     ADD ALLEN_BRADLEY_CONFIG
>         WITH IP "192.168.1.40"
>         WITH DEVICE_FAMILY 0
>     ADD MAPPING ValveControl
>         WITH EVERY 500 MILLISECONDS
>         ADD TAG Valve1Position
>             WITH ADDRESS "Valve1.Position"
>             WITH DATA_TYPE "INT"
>             WITH UNIT "%"
>             WITH SOURCE_TOPIC "valves/valve1/position"
>         ADD TAG Valve1Status
>             WITH ADDRESS "Valve1.Status"
>             WITH DATA_TYPE "BOOL"
>             WITH SOURCE_TOPIC "valves/valve1/status"
> ```

> [tab] Array elements
>
> Read specific array indices:
>
> ```lot wrap theme={"theme":{"light":"css-variables","dark":"css-variables"},"languages":{"custom":["/languages/lot.json"]}}
> DEFINE CONNECTOR ArrayData WITH TYPE ALLEN_BRADLEY
>     ADD ALLEN_BRADLEY_CONFIG
>         WITH IP "192.168.1.50"
>         WITH DEVICE_FAMILY 0
>     ADD MAPPING ArrayMonitor
>         WITH EVERY 1 SECOND
>         ADD TAG Zone1Temp
>             WITH ADDRESS "ZoneTemperatures[0]"
>             WITH DATA_TYPE "REAL"
>             WITH UNIT "°C"
>             WITH SOURCE_TOPIC "zones/zone1/temperature"
>         ADD TAG Zone2Temp
>             WITH ADDRESS "ZoneTemperatures[1]"
>             WITH DATA_TYPE "REAL"
>             WITH UNIT "°C"
>             WITH SOURCE_TOPIC "zones/zone2/temperature"
> ```

> [tab] Control loop
>
> Read process value and write setpoint from MQTT:
>
> ```lot wrap theme={"theme":{"light":"css-variables","dark":"css-variables"},"languages":{"custom":["/languages/lot.json"]}}
> DEFINE CONNECTOR ControlLoop WITH TYPE ALLEN_BRADLEY
>     ADD ALLEN_BRADLEY_CONFIG
>         WITH IP "192.168.1.100"
>         WITH DEVICE_FAMILY 0
>     ADD MAPPING TempControl
>         WITH EVERY 200 MILLISECONDS
>         ADD TAG PV
>             WITH ADDRESS "TIC100.PV"
>             WITH DATA_TYPE "REAL"
>             WITH SOURCE_TOPIC "control/tic100/pv"
>             WITH UNIT "°F"
>         ADD TAG SP
>             WITH ADDRESS "TIC100.SP"
>             WITH DATA_TYPE "REAL"
>             WITH SOURCE_TOPIC "control/tic100/sp"
>             WITH UNIT "°F"
>             WITH WRITABLE "true"
>             WITH DESTINATION_TOPIC "control/tic100/sp/set"
>             WITH MIN_VALUE 32
>             WITH MAX_VALUE 212
> ```

> [tab] Scaled analog
>
> Scale a 4–20 mA sensor to engineering units:
>
> ```lot wrap theme={"theme":{"light":"css-variables","dark":"css-variables"},"languages":{"custom":["/languages/lot.json"]}}
> DEFINE CONNECTOR AnalogSensors WITH TYPE ALLEN_BRADLEY
>     ADD ALLEN_BRADLEY_CONFIG
>         WITH IP "192.168.1.80"
>         WITH DEVICE_FAMILY 0
>     ADD MAPPING AnalogData
>         WITH EVERY 500 MILLISECONDS
>         ADD TAG Pressure
>             WITH ADDRESS "AI_Pressure"
>             WITH DATA_TYPE "REAL"
>             WITH UNIT "bar"
>             WITH DECIMAL_PLACES 3
>             WITH DEADBAND 0.01
>             WITH SOURCE_TOPIC "sensors/pressure"
> ```

***

## Best Practices

> [accordion] Choose the correct device family
>
> Use `DEVICE_FAMILY 0` for ControlLogix and CompactLogix (most common), `4` for Micro800, and `5` for MicroLogix. Legacy PLC5/SLC500 families (`1`/`2`) only for existing installations.

> [accordion] Program scope
>
> Controller-scoped tags use the name alone (`GlobalCounter`). Program-scoped tags need the full prefix: `Program:MainProgram.LocalCounter`.

> [accordion] PATH vs SLOT
>
> Set the CPU slot in `PATH` (`"1,0"` for backplane 1, slot 0). `SLOT` is kept for legacy parity, but routing is resolved from `PATH`. Micro800 (`DEVICE_FAMILY 4`) has no backplane: omit `PATH`. A `PATH` on a Micro800 route is ignored and logged as a warning.

> [accordion] Writable tags
>
> Use `WRITABLE "true"` with `MIN_VALUE` / `MAX_VALUE` on setpoints. Publish values in the forms under [Write value formats](#write-value-formats). Ensure the PLC is in Remote Run mode for writes to succeed.

> [accordion] Deadbands and polling
>
> Use `DEADBAND` on noisy analog values. Match `EVERY` to how fast the value changes — 500 ms for critical data, 1–5 s for slow status.

***

## Troubleshooting

> [accordion] Connection failed
>
> * Verify IP with `ping`
> * Confirm the EtherNet/IP port is open (default `44818`, or the `PORT` you set)
> * Ensure PLC is powered on and in **RUN** mode
> * Check `DEVICE_FAMILY` matches your controller type
> * Increase `TIMEOUT` on slow networks
> * Publish `-checkConnectorConnection <name>` to test the connection: with tags, the broker opens one tag the way a read does; with no tags, it checks the EtherNet/IP session

> [accordion] Tag not found
>
> * Tag names are **case-sensitive** — match Studio 5000 exactly
> * Program-scoped tags need `Program:ProgramName.TagName` (not `ProgramName:Tag`)
> * Verify the tag exists in Controller Tags or Program Tags in Studio 5000
> * For UDTs, include the member: `Valve1.Status` not `Valve1`
> * For arrays, include the index: `Temps[0]` not `Temps`

> [accordion] Path errors
>
> * Use `PATH "1,0"` for standard backplane routing (backplane, slot)
> * For Micro800, omit `PATH`. If you set one, the broker ignores it and logs a warning
> * Multi-hop paths use comma-separated segments: `"1,2,2,1"` through bridge modules

> [accordion] Micro800 issues
>
> * Set `DEVICE_FAMILY 4`
> * Omit `PATH`. Micro800 has no backplane; a `PATH` on this family is ignored and logged as a warning
> * Use Micro800 I/O tag names (`_IO_EM_DI_00`, `_IO_EM_AI_00`)
> * STRING uses a 1-byte length prefix (not the ControlLogix 4-byte format). A write can grow up to the tag's String Size in Connected Components Workbench; a longer string is rejected

> [accordion] Write operations fail
>
> * Set `WRITABLE "true"` and provide `DESTINATION_TOPIC`
> * PLC must be in **Remote Run** mode
> * Verify `DATA_TYPE` matches the PLC tag definition
> * Check value is within `MIN_VALUE` / `MAX_VALUE` if set
> * For `TOD`, publish milliseconds since midnight. The read form `hh:mm:ss.fff` is not a write payload

> [accordion] No value published, route Yellow
>
> * `DATA_TYPE` must match the PLC tag's actual type. On a mismatch the tag is refused: no value is published, the tag goes BAD, the log names both types, and route health leaves Green and goes Yellow
> * The check is strict. A PLC `INT` declared as `DINT` is refused too. That case used to read correctly by luck
> * Match PLC types exactly: DINT → `DINT`, REAL → `REAL`, BOOL → `BOOL`
> * `TIME` tags publish as `T#...` duration strings on MQTT
> * `DATE` publishes as `yyyy-MM-dd`. `TOD` publishes as `hh:mm:ss.fff`
> * For now, one failing tag can back off its whole mapping

***

## Next Steps

> [card] [EtherNet/IP Connector](https://docs.coreflux.org/v2.22/lot-language/routes/industrial/ethernetip.md)
>
> Explicit CIP Class/Instance/Attribute addressing for assembly objects and legacy devices.

> [card] [Industrial Connectors Overview](https://docs.coreflux.org/v2.22/lot-language/routes/industrial/overview.md)
>
> Compare OT connectors and choose the right protocol for your devices.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.