# Connections, lines and stations

> How the Drivers workspace models your equipment - one connection per controller, server or broker (Siemens S7, Rockwell Logix, Omron FINS, MELSEC over MC protocol, Modbus TCP, OPC UA, MQTT), or a serial line, CAN bus, RTU gateway or Modbus TCP gateway with one station per device - what each protocol needs, how each device is polled at its own scan rate, which drivers write text, and how existing channels and devices map onto it.

Product: eaxScada · Type: Explanation · Editions: Starter, Pro, Enterprise
Source: https://eaxware.com/docs/eaxscada/explanation/connections-and-stations/
Status: migrated page, not yet verified against the current code.

The Drivers workspace connects eaxScada to your equipment in one of two shapes, depending on the protocol.

## A connection: one address, one controller

Most protocols reach **one** controller, server or broker per address:

| Connects to | One connection is | You give |
|---|---|---|
| Siemens S7 (S7-300/400/1200/1500, ISO-on-TCP) | one S7 CPU | IP address, CPU family, rack and slot |
| Rockwell / Allen-Bradley Logix (ControlLogix, CompactLogix, EtherNet/IP) | one Logix controller | IP address, controller slot (or a route) |
| Rockwell / Allen-Bradley MicroLogix, SLC 500, PLC-5 (PCCC) | one MicroLogix 1100/1400, SLC 5/05 or PLC-5 Ethernet controller | IP address, controller family, port, request timeout |
| Omron CJ2M, CJ2H, CS1, CP1E, CP1L, CP1H, NJ/NX (FINS) | one CS/CJ, CP or NJ/NX controller | IP address, FINS/UDP or FINS/TCP, controller series, FINS nodes |
| Mitsubishi Electric MELSEC iQ-R, iQ-F (FX5U, FX5UC, FX5UJ), Q, L (MC protocol / SLMP) | one MELSEC controller (or one reached through it by the route) | IP address, the port opened for SLMP, PLC series, TCP or UDP, 3E or 4E frame |
| Omron NJ501, NJ301, NJ101, NX701, NX502, NX102, NX1P2 (EtherNet/IP tags) | one NJ/NX controller, through its built-in EtherNet/IP port | IP address, port (44818), request timeout |
| EtherNet/IP device (drives, I/O adapters) | one EtherNet/IP device that is not a controller | IP address, port, request timeout |
| Modbus TCP device | one Modbus TCP device | IP address, port, unit id |
| OPC UA server | one server | endpoint URL, security |
| MQTT broker | one broker | broker URL |
| NATS bridge | one NATS server or cluster, or this server's own broker | URL and subjects; for this server's broker only the subjects (no credentials) |
| Raw serial port | one port | port and framing |

**Drivers → Add connection** asks for these once, creates the connection, and offers **Test connection** and **Browse tags** in the same dialog. There is no separate device step: the connection keeps its polling rate, its UNS prefix and its tags under the **Polling & UNS** and **Tag Mappings** tabs, and the address is never asked twice.

A Modbus TCP device connection reads one unit id: every request goes to the unit id set on the connection. For several devices behind one Modbus TCP gateway, use a Modbus TCP gateway instead (below).

## A line: several stations on one medium

Serial lines, CAN buses and gateways carry **several** devices, told apart by an address on the line:

| Line | A station is | Station address |
|---|---|---|
| Modbus RTU serial line (RS-485 / RS-232) | one Modbus device | unit id, 1-247 |
| Modbus ASCII serial line | one Modbus device | unit id, 1-247 |
| Modbus RTU over TCP (serial device server or gateway in transparent mode) | one Modbus device behind the gateway | unit id, 1-247 |
| Modbus TCP gateway (several devices behind one IP address) | one Modbus device behind the gateway | unit id, 1-247 |
| CANopen bus | one CANopen node | node id, 1-127 |
| Raw CAN bus | a node, when an address is node-scoped | node id, optional |

**Add connection** with a line protocol creates the line (port, baud rate, framing, or the gateway's address). **Add station** then adds one device on it by its unit or node id; each station has its own UNS prefix and tags. Add station only offers lines: a controller, server or broker is its own connection and has no station.

How to set up a line is described in [Connect serial and CAN devices](/docs/eaxscada/how-to/connect-serial-and-can-devices/). In the project explorer a line shows its stations under it, each with its unit or node id; a connection is one row. The **Line** (or **Gateway**) tab lists the stations in a table: each one's unit or node id, its state (answering, not responding, some tags BAD), how many of its tags are GOOD and BAD, and the last error of its tags. A station whose tags are BAD is marked in the table; its marker opens the reason.

## A Modbus TCP gateway: several devices behind one IP address

Energy meters, drives and RTUs on an RS-485 bus are often reached through a Modbus TCP to RTU gateway: one IP address, and each device behind it answers at its own unit id. eaxScada reaches them all over **one** TCP connection to the gateway:

1. **Drivers → Add connection**, and choose **Modbus TCP gateway (several devices behind one IP address)**.
2. Give the gateway's **IP address** and **port** (502 unless the gateway uses another). The **Test unit id** is the unit **Test connection** asks; a station without its own unit id uses it too.
3. **Create gateway**, then **Add station** once per device: its **unit id** (1-247, as set on the device) and a name. A unit id that is already a station on this gateway is refused.
4. Map each station's tags (import its register map, or map addresses such as `HR:0`), as for any Modbus device.

What the driver does:

- Each read and write carries the unit id of its station in the Modbus TCP header. Requests go one at a time over the one connection, each bounded by 2 s, or by `timeout_ms` in the channel's settings (100 ms to 30 s).
- A write goes to exactly that unit id. A station whose station id is not a unit id (1-247) has its writes refused and its tags BAD: nothing is ever sent to another unit instead. Unit id 0 (broadcast) is refused.
- One device that does not answer (a timeout, or the gateway's own exception 0x0B "target device failed to respond") makes only **its** tags BAD. The connection is kept and the other stations stay GOOD. After 3 timeouts in a row the device is polled once every 5 s until it answers, so its timeouts do not slow the others. An answer that arrives after its request timed out is recognised and discarded, never taken for another unit's answer.
- The connection is dropped and redialled when the connection itself fails (closed, cut in the middle of an answer), or when no device behind the gateway has answered for 30 s.
- The connection's **Link** diagnostics (frames, timeouts, exceptions, the units not answering, the current and previous error, naming the unit) are the same as a serial line's.
- Neighbouring tags of one station are read in blocks, one request per block, never across two unit ids. See [Modbus block reads](/docs/eaxscada/how-to/connect-serial-and-can-devices/#modbus-block-reads).

A **Modbus TCP device** connection keeps working exactly as before: every request goes to its unit id, and its device's station field (which holds the IP address) is not read. When that field holds a different unit id (from an older configuration, or typed by hand), the device's tags are marked **Sent to unit n** in the Tag Mappings table: the requests go to the connection's unit id, and a Modbus TCP gateway is the way to address several unit ids. In the stored configuration a gateway is a `MODBUS_TCP` channel with `"gateway": true` in its settings; each station is a device whose `station_id` is the unit id. A gateway with stations cannot be switched back to a Modbus TCP device connection (its stations' requests would all go to one unit id): delete the stations first.

This has been verified against eaxware's Modbus simulator (`tools/plc-sim/modbus_server.py --units 1,2,3 --silent-file <file>`, which answers several unit ids with different registers and makes a unit silent on demand), not yet against a specific gateway model.

## Supported controllers and requirements

Each connection dialog, and the **Connection** tab of each connection, has a **Supported controllers and requirements** panel: what the driver reads, what it does not, and what to set up on the device. The guides give the same lists with the steps:

- [Connect to an S7 PLC](/docs/eaxscada/how-to/connect-to-an-s7-plc/)
- [Connect to a Logix controller](/docs/eaxscada/how-to/connect-to-a-logix-controller/)
- [Connect to a MicroLogix, SLC 500 or PLC-5](/docs/eaxscada/how-to/connect-to-a-micrologix-slc-or-plc-5/) (data-table addresses such as `N7:0`, over EtherNet/IP with PCCC)
- [Connect to an EtherNet/IP device](/docs/eaxscada/how-to/connect-to-an-ethernet-ip-device/) (drives, remote I/O adapters: values by class, instance and attribute)
- [Connect a MicroLogix, SLC 500 or PLC-5 on a serial port (DF1)](/docs/eaxscada/how-to/connect-a-df1-serial-controller/)
- [Connect to Omron CJ2, CS1, CP1 and NJ/NX controllers (FINS)](/docs/eaxscada/how-to/connect-to-an-omron-fins-controller/) (memory-area addresses such as `D100`, `CIO 0.00`, `E0_100`)
- [Connect to Mitsubishi Electric MELSEC iQ-R, iQ-F, Q and L controllers (MC protocol / SLMP)](/docs/eaxscada/how-to/connect-to-a-mitsubishi-mc-protocol-controller/) (device addresses such as `D100`, `M10`, `X1F`)
- [Connect serial and CAN devices](/docs/eaxscada/how-to/connect-serial-and-can-devices/)

## Scan rates

Every device is polled at its own scan rate: the **Device Scan Rate (ms)** of the connection's device (on the **Polling & UNS** tab) or of each station of a line (`scan_rate_ms` in the configuration).

- A connection or station created in the Studio starts at **250 ms**. A device without a scan rate is polled every **100 ms**; the smallest rate is 10 ms.
- A poll that takes longer than the scan rate is followed by the next one at once, never by two at a time.
- The devices of one channel poll independently: a slow or silent device does not hold back the others' cycles. On a shared medium (a serial line, a gateway, one TCP connection) the reads take turns, one at a time, so another device waits at most for the read in progress.
- A write does not wait for the polls: it waits only for the read in progress.

The measured rate is in each connection's **Link** card (*Scan* rows: set and measured, marked when the measured rate is well above the set one) and in the **Scan** column of a line's stations table (set / measured). A measured rate far above the set one means the line or the controller cannot keep up.

On a **slow serial line**, give each station the rate the line can carry. Each tag of a serial station is one request: on DF1 at 19200 baud count about 25 ms per tag, so 40 tags need about 1 s, and polling them at 250 ms only queues the reads. Poll fast only what operators need fast (a few status bits), and put slow values (totals, temperatures) on a second station or a slower rate.

Before this release every channel was polled on a fixed 100 ms cycle, whatever its devices' scan rate. Devices set to 250 ms are now polled every 250 ms: lower the scan rate of a device whose values must update faster.

## Text tags

A tag mapping with the data type **String** reads and writes text. Text writes work on the drivers whose protocol carries text: **Omron FINS** and **Mitsubishi Electric MC protocol / SLMP** (a string in controller memory, read back as text too), **OPC UA** (a String value), and **MQTT** with a JSON payload and the **NATS bridge**. They are refused, with nothing sent, on station-addressed drivers (serial lines, buses and gateways such as Modbus RTU, DF1 or CANopen): the text exchange carries no station address, so it could reach the wrong device. Every other driver writes numbers only. The rules and limits are in [Limit tag writes](/docs/eaxscada/how-to/limit-tag-writes/#text-tags).

A **NATS bridge** never writes to a telemetry subject (`uns.telemetry` or anything under it), numbers or text: such a write is refused ("telemetry subjects are read-only for a NATS channel; write through uns.command.write"), because it would put a value on the bus as that tag's reading beside its real producer. A write the broker refuses (a permissions violation) is reported as failed, never as written.

A NATS bridge set to read eaxScada's own broker signs in with an identity of its own that may only subscribe to its inbound subjects (under `uns.telemetry.`); it publishes nothing, so every write on it is refused.

## Credentials in a URL

A password in a broker or endpoint URL (`nats://user:password@host`) is a secret: it is stored encrypted, shown as `********` in the Studio and the API, and as `***` in connection tests and logs. Saving the channel unchanged keeps it; changing the host or user asks for it again.

Switching a connection back to its own protocol before saving keeps its stored credentials; saving it under another protocol does not carry them over.

## MQTT and Sparkplug B

An MQTT broker connection reads JSON topics and, as a Sparkplug B host, the NBIRTH, NDATA, NDEATH, DBIRTH, DDATA and DDEATH messages of the edge nodes on the broker.

### Which tags a message may write

Any client allowed to publish on the broker reaches the channel's subscription, so a message writes only the tags the channel maps to its topic (safety: values operators see):

- **The mapping's address is the topic.** A JSON or raw message on a topic writes the tags of this channel whose mapping address is that topic. Without a `path` in the payload, every tag mapped to the topic takes the value.
- **A payload `path` must be one of those tags.** A payload that names any other tag is dropped. Earlier releases wrote whatever tag the payload's `path` named, or the tag the topic named (minus `sensors/`): another channel's tag, or a new tag no channel mapped.
- **A topic no tag of the channel is mapped to creates no tag**; the message is dropped.
- **Sparkplug B values** are written only to a path this channel maps (under any address).
- **Also accept unmapped tags under** (`ingest_path_prefix`, empty by default) is the only way to take a tag the channel does not map: a path under that tag-path prefix (for example `Plant/Edge`; the payload's `path`, else the topic without `sensors/`, or a Sparkplug path) is accepted when no other channel maps it. A prefix with an MQTT wildcard (`+`, `#`) or a `*`, or nothing but `/`, is no prefix: it is ignored with a warning in the log.
- **Another channel's tag is always refused**, whatever the prefix.

A mapping added, changed or removed applies from the next message, without a reconnect. Each dropped message is counted in `eaxscada_mqtt_ingest_refused_total{channel, reason}` ([Metrics](/docs/eaxscada/reference/metrics/#tags-and-drivers)), and a warning "MQTT message dropped: it names no tag this channel maps to its topic" is logged at most once every 10 seconds per channel and reason. A dropped message is not recorded either: a read of its topic does not see it.

### Quality

The value's quality follows the specification:

- **A metric's Quality property is its tag's quality** (192 Good, 64 Uncertain, 0 Bad, 500 Stale; Stale reads Uncertain). A metric its edge node sends as Bad reads Bad.
- **NDEATH makes the edge node and all its devices Bad; DDEATH makes that device Bad.** A late death message that carries an older birth sequence (`bdSeq`) than the node's current session changes nothing.
- **A gap in the sequence number** (frames lost) makes the node's Good values Uncertain until its next NBIRTH, and eaxScada asks the node for a rebirth.
- **A birth replaces the list of metrics** of its node or device and resets the metric aliases. A metric the new birth no longer has reads Bad and can no longer be written.
- **Values are decoded as sent:** signed integers keep their sign; a null metric, or a float that is not finite, reads Bad and keeps the last value.
- **Commands are never values.** NCMD, DCMD and STATE messages on the broker are never taken in as tag values.

**Browse** offers each metric by its full address: `spBv1.0/<group>/NDATA/<edge node>/<metric>` for a node metric, `spBv1.0/<group>/DDATA/<edge node>/<device>/<metric>` for a device metric. NCMD and DCMD topics are not offered. A write by that address goes to exactly that node (NCMD) or device (DCMD), never to a metric of the same name on another node or device. After NDEATH the node and all its devices refuse commands, and after DDEATH that device does; after NDEATH a device stays offline until its own DBIRTH.

## Channels and devices in the configuration

The configuration file and the API keep their names: a connection or a line is a **channel**, its device or each station is a **device** (`station_id` holds the unit or node id), and the stored protocol ids do not change (`ISO_ON_TCP` for Siemens S7, `ETHERNET_IP` for Rockwell Logix, `ETHERNET_IP` with `controller_type` `MicroLogixPCCC`, `SLC500PCCC` or `PLC5PCCC` for a MicroLogix, SLC 500 or PLC-5, and `ETHERNET_IP` with `controller_type` `DeviceCIP` for an EtherNet/IP device, `FINS` for an Omron FINS controller and `MC_SLMP` for a MELSEC controller over MC protocol). The settings are listed in [Driver channels, devices and tags](/docs/eaxscada/reference/generated/config/drivers/).

Existing configurations load unchanged:

- A connection with one device shows as one row; its device holds its tags, as before.
- A connection that has several devices (from an older configuration) still lists them. They all talk to the same controller: for these protocols the device's station id is not used. This includes a Modbus TCP connection without `"gateway": true`: all its devices use the connection's unit id.
- S7 families saved as `ISO-1500`, `ISO-1200`, `ISO-300` or `ISO-400` are read as `S7-1500`, `S7-1200`, `S7-300` and `S7-400`, and written that way at the next save. A value sent in the old form through the API is accepted.
