# Connect to a MicroLogix, SLC 500 or PLC-5

> Read and write the data table of a Rockwell / Allen-Bradley MicroLogix 1100/1400, SLC 5/05 or PLC-5 Ethernet controller over EtherNet/IP (PCCC) - the controller families, data-table addresses (N7:0, F8:3, B3:0/5, T4:2.ACC, C5:0.PRE, S:1, I:1.0/3, PLC-5 octal I/O, L9:0), the data types, batched reads, errors in words, and how writes are checked, sent and confirmed.

Product: eaxScada · Type: How-to guide · Editions: Starter, Pro, Enterprise
Source: https://eaxware.com/docs/eaxscada/how-to/connect-to-a-micrologix-slc-or-plc-5/
Status: migrated page, not yet verified against the current code.

eaxScada reads and writes the data table of the older Rockwell / Allen-Bradley controllers that speak **PCCC** over EtherNet/IP:

- **MicroLogix 1100 and 1400**, on their Ethernet port;
- **MicroLogix 1000, 1200 and 1500** behind an Ethernet adapter that answers EtherNet/IP (for example a 1761-NET-ENI) - not yet verified;
- **SLC 5/05**, on its Ethernet port;
- **PLC-5 Ethernet** controllers (PLC-5/20E, 5/40E, 5/80E and the other PLC-5/xxE), on their Ethernet port.

These controllers hold no tag names on the network: each value is read by its **data-table address** (`N7:0`, `T4:2.ACC`), exactly as it is written in the controller's programming software. The PCCC commands travel in the CIP *Execute PCCC* service, in unconnected messages to the controller's own IP address (TCP port 44818). The connection is stored as protocol `ETHERNET_IP` with `controller_type` `MicroLogixPCCC`, `SLC500PCCC` or `PLC5PCCC`.

For a ControlLogix, CompactLogix or Micro800, use [Connect to a Logix controller](/docs/eaxscada/how-to/connect-to-a-logix-controller/) instead: those are read by tag name.

## What is supported

Supported:

- One connection per controller, to its own IP address.
- Reads of integer (N), floating-point (F), bit (B), timer (T), counter (C), status (S), input (I) and output (O) files, and long-integer (L) files on a MicroLogix.
- **Batched reads**: once the addresses are known, the close elements of one file are read with one request (at most 200 bytes, so 100 integers or 33 timers). A batch the controller refuses - an element beyond the end of a file, say - is read again address by address, so one bad address never makes its neighbours BAD.
- **Errors in words, per tag**: a tag the controller refuses is BAD with its reason, for example `N10:0: address does not exist in the controller (file not found, or no such element) (PCCC STS 0xF0, EXT STS 0x06)`, `file is wrong size (the element is beyond the end of the file)`, `illegal command or format`, `processor is in program mode`.
- The controller's **identity** (product name, revision, serial number), read when the connection opens and shown on the **Connection** tab with the request, answer, error-status and timeout counters. **Test connection** opens its own session and reads the status-file word `S:0`.

- **Writes** to exactly the mapped address, sent once, with every check made before sending (see [Writes](#writes)).

Not supported:

- **Browsing**: the controller has no tag names to list. Map each address.
- A controller behind a ControlLogix chassis or a DH+ bridge (a CIP route), and DH+ links: connect to the controller's own Ethernet port. A connection with a route is refused. A controller on its serial port: see [Connect a MicroLogix, SLC 500 or PLC-5 on a serial port (DF1)](/docs/eaxscada/how-to/connect-a-df1-serial-controller/).
- String (ST), ASCII (A), BCD (D), control (R), message (MG), PID (PD), SFC and block-transfer (BT) files; indirect (`N[N7:0]:0`) and indexed (`#N7:0`) addresses.

All of this is verified against eaxware's PCCC simulator (`tools/plc-sim/pccc_server.py`, in its MicroLogix and PLC-5 forms) and against an in-process test controller, with every request pinned byte for byte against the DF1 protocol reference. **It has not been verified against a real controller**: no MicroLogix, SLC 500 or PLC-5 has been on the test bench yet.

## Addresses

| Address | Means | Data type |
|---|---|---|
| `N7:0` | integer file 7, element 0 | Int16 (or UInt16: the raw 16 bits) |
| `N7:0/3` | bit 3 of `N7:0` | Bool |
| `F8:3` | floating-point file 8, element 3 | Float32 |
| `B3:0/5` | bit file 3, word 0, bit 5 | Bool |
| `B3/37` | bit 37 of bit file 3, counted from its start (the same bit as `B3:2/5`) | Bool |
| `B3:2` | the whole word 2 of bit file 3 | Int16 / UInt16 |
| `T4:2.ACC`, `T4:2.PRE` | timer 2's accumulated and preset values | Int16 |
| `T4:2.DN`, `.EN`, `.TT` | timer 2's done, enabled and timing bits (`T4:2/DN` is accepted) | Bool |
| `C5:0.ACC`, `C5:0.PRE` | counter 0's accumulated and preset values | Int16 |
| `C5:0.DN`, `.CU`, `.CD`, `.OV`, `.UN` | counter 0's status bits | Bool |
| `S:1`, `S:1/5` | status file (file 2) word 1, and its bit 5 (`S2:1` is accepted) | Int16 / Bool |
| `I:1.0/3` | MicroLogix, SLC 500: input slot 1, word 0, bit 3 (`I:1/3` is word 0) | Bool |
| `O:2.0` | MicroLogix, SLC 500: output slot 2, word 0 | Int16 / UInt16 |
| `I:012/07` | PLC-5: input word 012 (rack 01, group 2), bit 07 - **both octal** | Bool |
| `L9:0` | MicroLogix 1100/1400 long-integer file 9, element 0 | Int32 |

Rules, checked when the mapping is saved (in the studio or through the API) and again by the driver before any request, so nothing is ever sent to a wrong address:

- Data files are numbered 3-255 on a MicroLogix or SLC 500, 3-999 on a PLC-5; elements 0-255, or 0-999 on a PLC-5. The output, input and status files are 0, 1 and 2, written `O:`, `I:` and `S:`.
- Numbers are decimal, except a PLC-5 input or output word and bit, which are octal as the PLC-5 writes them (`I:012/17` is bit 15 of word 10; `I:018` is refused).
- Bits are 0-15 (0-31 in an L element). A floating-point element has no bits; an integer element has no sub-element (`N7:0.1` is refused: write `N7:0/1` for a bit).
- A timer or counter address names its field: `T4:2` alone is refused.
- The **data type** must be the one the address holds: Int16 (or UInt16) for a word, Float32 for an F element, Int32 for an L element, Bool for a bit. `N7:0` mapped as Float64 is refused with `N7:0 is a 16-bit word: use the data type Int16 (or UInt16 for the raw 16 bits)`; it is never read as a plausible number of another size.

### Example: a pump station on a MicroLogix 1400

This is an example of the form; your program's files and their numbers are your own. It is verified against eaxware's simulator, not against a real controller.

| Tag | Address | Type |
|---|---|---|
| Wet-well level (counts) | `N7:10` | Int16 |
| Flow (m³/h) | `F8:0` | Float32 |
| Pump 1 running | `B3:0/0` | Bool |
| Pump 1 run-time timer | `T4:0.ACC` | Int16 |
| Pump 1 run-time done | `T4:0.DN` | Bool |
| Pump starts today | `C5:0.ACC` | Int16 |
| Total volume (m³) | `L9:0` | Int32 |
| Float switch high | `I:0.0/3` | Bool |

## Add the connection

1. **Drivers → Add connection**, and choose **Rockwell / Allen-Bradley MicroLogix, SLC 500, PLC-5 (PCCC)**.
2. **Controller family**: MicroLogix, SLC 5/05 or PLC-5 Ethernet. It decides the commands sent and the address rules (L files on a MicroLogix only; octal I/O on a PLC-5).
3. **Controller IP address**, the **port** (44818) and the **request timeout** (2000 ms; 100-30000). There is no route: eaxScada connects to the controller's own Ethernet port.
4. **UNS prefix** (optional): where this controller's tags go in the UNS.
5. **Create connection**, then **Test connection**. A success means the controller registered an EtherNet/IP session and answered a PCCC read of the status file: the message names the family and the identity it answered.
6. Map the values with **Tag Mappings → + Map New Tag**: the address and the data type (Int16, Float32, Int32 or Bool, above). A mapping the server refuses stays in the dialog with the reason.

The data files you map must exist in the controller's program, with at least as many elements as you read: a missing file reads BAD *address does not exist*, an element beyond the end *file is wrong size*.

## How reads work

Every poll asks the driver for each mapped tag. The first time an address is asked for, it is read alone; from then on, the addresses of one file that lie close together (at most 8 unread elements between two mapped ones, at most 200 bytes in all) are read with one request, and the other addresses of the batch take their value from it. Timers and counters are read whole (three words), so `T4:2.ACC`, `T4:2.PRE` and `T4:2.DN` cost one read together. On a MicroLogix or SLC 500 an input or output address is read by slot and word, one word per request.

A request the controller does not answer within the request timeout makes the tag BAD (*no answer*); the session is then closed and reopened before the next request, so a late answer is never taken for another request.

## Writes

**Diagram: A write through the driver, stage by stage** (data flow)

A write passes four checks in order before anything is sent: the write policy of the eaxScada server with its electronic signature, the read-only mark of the tag mapping, the write range of the mapping, and the checks of the driver. Each of them can refuse, and then nothing reaches the controller or device. A write that passes is sent as one request to exactly the mapped address. The answer decides: a good answer, an error status, or no answer, which is reported NOT CONFIRMED and never repeated.

**Parts**

- **Write policy** (check or decision): and e-signature, in the server
- **Read only?** (check or decision): the mark of the tag mapping
- **Write range** (check or decision): of the mapping, if set
- **Driver checks** (check or decision): before anything is sent
- **Refused before sending** (outcome): nothing reaches the controller or device. A write is also refused here on a standby node, while the runtime is stopped, and while the connection is down (reported as "write not sent").
- **Controller or device** (device or controller): one request to exactly the mapped address
- **Written** (outcome): the write is confirmed
- **Refused** (outcome): reported with its reason
- **NOT CONFIRMED** (outcome): applied or not; never repeated

**Connections**

- **Write policy → Read only?** (command to equipment). The server has checked the limits and interlocks of the tag, a screen button's confirmation and signature, and the e-signature the tag asks of external writers.
- **Read only? → Write range** (command to equipment)
- **Write range → Driver checks** (command to equipment)
- **Write policy → Refused before sending** (refusal). The write policy refuses the value, or the signature or confirmation it requires is missing.
- **Read only? → Refused before sending** (refusal). A mapping marked read only refuses every write, whoever sends it.
- **Write range → Refused before sending** (refusal). The value is outside the write range of the mapping.
- **Driver checks → Refused before sending** (refusal). An address or a data type that is not valid, or a value the type cannot hold exactly. On a MicroLogix, SLC 500 or PLC-5 also the status (S), input (I) and output (O) files and the status bits of a timer or counter.
- **Driver checks → Controller or device** (command to equipment): one request. A MicroLogix, SLC 500 or PLC-5: a typed write of the value, or for a bit a write that changes that bit only. An EtherNet/IP device: one Set Attribute Single.
- **Controller or device → Written** (reply): a good answer
- **Controller or device → Refused** (refusal): an error status. For example "processor is in program mode" from a controller or "attribute not settable" from a device.
- **Controller or device → NOT CONFIRMED** (reply, not active): no answer. The request was sent once and the answer is lost: the controller or device may or may not have applied the write. The session is closed and opened again before the next request, so a late answer is never taken for another one.

Every check comes before the one request. A lost answer is never turned into a second write.

A write to a MicroLogix, SLC 500 or PLC-5 tag goes through the same path as every other write: the server's write policy and e-signature (a screen button's confirmation and signature, or the tag's *e-signature for external writers*), then the mapping's checks, then the driver. In that order:

1. A mapping marked **read only** refuses every write, whoever sends it, before anything is sent.
2. The mapping's [write range](/docs/eaxscada/how-to/limit-tag-writes/), if set, refuses a value outside it.
3. The driver refuses, before sending:
   - the **status (S), input (I) and output (O) files**: the processor's own status, the input modules' values, and the output image the program writes (write the bit or word the program copies to the output instead);
   - a **timer's or counter's status bits** (`.DN`, `.EN`, `.TT`, `.CU`, `.CD`, `.OV`, `.UN`): only `.PRE` and `.ACC` are written;
   - a value the type cannot hold exactly: Int16 is -32768 to 32767 (40000 is never sent as -25536), UInt16 0 to 65535, Int32 a 32-bit integer, no fraction for an integer, no NaN or infinity for a Float32, only 0 or 1 for a bit;
   - an address or data type that is not valid.
4. One request goes to exactly the mapped address:
   - a word, an F or an L element, or a timer's or counter's `.PRE` / `.ACC`: a typed write of that value only (MicroLogix / SLC 500: protected typed logical write, `0F AA`; PLC-5: word range write, `0F 00`). Writing `T4:2.PRE` writes the preset word of timer 2 and nothing else of it;
   - a **bit**: a write that changes that bit only (MicroLogix / SLC 500: masked write, `0F AB`, with a mask of that one bit; PLC-5: read-modify-write, `0F 26`, done by the controller itself). eaxScada never reads the word and writes it back itself, so it never writes back a stale copy of the other 15 bits. On a PLC-5, the DF1 reference manual warns that the controller's own read-modify-write can overwrite a bit the program changes during that command: write bits in a word the program only reads.
5. The controller's answer decides: an error status (for example *processor is in program mode*, *address does not exist*) is reported with its words and nothing is changed. If the answer is lost, the write is reported **NOT CONFIRMED** - the controller may or may not have applied it - and it is **never repeated**; the session is closed and reopened before the next request, so a late answer is never taken for another one.

## The connection afterwards

The **Connection** tab holds the family, address, port and timeout, the requirements panel, and a **Controller** card: the identity the controller answered when the connection opened, the requests sent and answered, the timeouts, the error statuses answered, and the last error. **Tag Mappings** shows each tag's quality; a tag the controller refused is marked on its row in the grid, and the marker opens the reason.
