Connect and model

Devices

Connect PLCs, meters, OPC UA servers and MQTT edge nodes - protocol settings, address formats, scan classes and the built-in simulator.

A device is one connection: a PLC, a meter, a gateway in front of serial equipment, an OPC UA server, an MQTT Sparkplug edge node, or the built-in simulator. Device tags read and write through it (see Tags).

Open Devices to see every device with its protocol, address, connection state and how many tags it serves. Choose Add device to create one.

The Edit Device dialog for a Modbus TCP device, with its name, asset, transport, host, port and unit ID

Supported protocols

ProtocolConnects toHow values arrive
Modbus TCPPLCs, meters and gateways on EthernetPolled by scan class
Modbus RTURS-485/RS-232 devices on a serial port of the gatewayPolled by scan class
Modbus RTU over TCPSerial devices behind a serial-to-Ethernet converterPolled by scan class
Siemens S7S7-300/400/1200/1500 over ISO-on-TCPPolled by scan class
EtherNet/IP (CIP)Allen-Bradley Logix controllers, by tag namePolled by scan class
Omron FINSOmron CS, CJ, CP, NJ and NX controllers, over TCP or UDPPolled by scan class
OPC UAAny OPC UA serverSubscriptions: the server reports changes
MQTT Sparkplug BEdge nodes publishing through an MQTT brokerThe device pushes changes
SimulatorNothing: values are made up inside the gatewayGenerated by scan class

Every device has an optional asset, which places it in the asset hierarchy and limits who can see it.

Modbus

SettingMeaning
TransportTCP, RTU (serial) or RTU over TCP
Host and PortFor TCP and RTU over TCP (port 502 by default)
Serial port, Baud rate, Parity, Data bits, Stop bitsFor RTU: /dev/ttyUSB0 on Linux, COM3 on Windows
Unit IDThe slave address (1-247; often 1, or 255 for TCP devices). Tags can override it
Default byte orderFor 32- and 64-bit values; tags can override it
Registers per readThe largest read, up to 125 registers (default 120)
Gap to bridgeUnused registers a read may span to combine neighbouring tags (default 16)
Timeout (ms)How long to wait for an answer

Modbus addresses

Type addresses the way the device manual prints them. They are one-based:

You typeNexus reads
40001, 400001 or HR1Holding register 1
30001, 300001 or IR1Input register 1
10001 or DI1Discrete input 1
00001 or C1Coil 1

The editor shows the zero-based protocol address it stores. Coils and holding registers are writable; input registers and discrete inputs are read-only.

Data types: bool (a coil, a discrete input, a whole register, or one Bit of a register), int16/uint16, int32/uint32 and float32 (2 registers), int64/uint64 and float64 (4 registers), and string (2 characters per register; set Registers for its length).

Byte order for multi-register values:

OrderMeaning
ABCDBig-endian, the Modbus standard
CDABWord swap, common for 32-bit floats in PLCs
BADCByte swap
DCBALittle-endian

Tip. If a float reads as a huge or tiny number, try CDAB.

How Modbus reads are combined

Tags of the same table and unit ID are read together in blocks. If a device rejects a block (because an unimplemented register lies inside a gap), that block is read tag by tag from then on, so one bad address only affects its own tag:

  • A rejected address or a timed-out read marks just those tags bad quality.
  • Only a broken link, or every request timing out, reconnects the device.
  • An address that can’t work, such as a float in a coil, is refused when the tag is saved.

Siemens S7

Set the PLC’s Host, Rack (usually 0) and Slot (1 for S7-1200/1500, often 2 for S7-300/400). Tags address a data block:

FieldExample
DB number1
Byte offset0
Data typebool, byte, int, dint, real
BitFor bool: 0-7

For S7-1200/1500, allow PUT/GET communication in the PLC and turn off optimized block access for the data blocks you read.

EtherNet/IP

Set the controller’s Host and Slot (the CPU’s slot in the chassis, usually 0). Tags use the controller’s own Tag name, for example Pump01_Speed.

Omron FINS

Set the Host, Port (9600), FINS over TCP or UDP, and the Timeout. Over UDP, the PLC node defaults to the last number of the PLC’s IP address and the Gateway node to the last number of the gateway’s; over TCP the nodes are negotiated.

An address is an Area, a Word address and, for booleans, a Bit, as the programming software shows them:

In the softwareAreaWordBit
D100DM100
W3.05WR35
E2_10EM, bank 210

Areas: DM, CIO, WR, HR, AR and EM. Data types are the same as Modbus. For 32- and 64-bit values, Omron keeps the low word first; set Word order to high-first for data laid out the other way.

OPC UA

Enter the server’s Endpoint URL, for example opc.tcp://plc-01:4840. Values arrive through subscriptions, so OPC UA devices don’t poll.

To create tags from the server’s address space, open Tag Explorer → Discover OPC UA, choose the OPC UA device, browse the server, pick the nodes you want, a target folder and a scan class, and add them as tags. A tag’s address is its Node id, for example ns=2;s=Pump01.Speed.

MQTT Sparkplug B

Enter the Broker URL (mqtt://broker:1883 or mqtts://broker:8883), the Group ID and the Edge Node ID of the node to read, and a username and password if the broker needs them. Tags address a Metric name, for example Line1/Speed. Values arrive as the node publishes them, and writes are sent as Sparkplug commands.

Simulator

The simulator makes values up inside the gateway: no PLC, no extra process and no port. Use it for demos, training, and building screens, alarms and history before the real device is connected. It has scan rates and nothing else to set.

Each simulator tag picks a Signal:

SignalValueSettings
sine, triangle, ramp, squareA wave between min and max, one cycle per periodMin, Max, Period (s), Noise (% of the range, optional)
randomWanders between min and max, crossing the range in about a periodMin, Max, Period
countermin, min+1 … max, then min again, a step per periodMin, Max, Period
memoryHolds a value until something writes to it, for setpoints and commandsStarts at

Values take the tag’s data type: integers round, and a boolean is on in the upper half of the wave (a square wave is on/off). Only memory tags take writes. Waves follow the clock, so a restart doesn’t reset them and both gateways of a redundant pair show the same values.

To move to the real PLC later, change the tags’ device and addresses (or the UDT template’s). Views, alarms and history keep the same tag IDs.

Scan classes

Polled devices read each tag at its scan class. Three are built in:

Scan classDefault rate
fast250 ms
normal1 s
slow5 s

A device can change those rates under Devices → (device) → Scan rates, for example slower for a PLC on a radio link.

Under Tag Explorer → Scan classes you can add your own classes and choose how each one reads:

  • Direct: every tag at the class’s rate.
  • Leased: tags at the rate while someone is looking at them (a screen, a live view), and at a slower idle rate otherwise.
  • Driven: reads follow a condition: at the rate while it is true, once each time it rises, or once each time its value changes; otherwise at the idle rate.

For OPC UA devices a class can be subscribed (the server samples at the rate and reports changes, with a queue size so fast changes aren’t lost) or polled. The dialog warns when a class is overloaded, meaning reads take most of its rate or longer: slow it down or split its tags.

Connection state and diagnostics

Each device has a _system.<device>.connected tag, so you can show its state on a screen or alarm on it. Tag Explorer shows why a tag is bad: device offline, address rejected, read timing out.

To alarm when a device’s tags go bad, add a bad quality alarm rule (see Alarms) with a delay to ride through brief communication blips.

Serial ports

  • Linux: the service needs the dialout group; see Installation.
  • Windows: if the service account can’t open the port, reinstall with install.ps1 -ServiceAccount LocalSystem.
  • Docker: pass the port through to the container; see Installation.

Drivers run apart from the gateway

Drivers with native code (Siemens S7 and Modbus RTU) run in a separate driver host process. If one crashes or hangs, only its devices show disconnected while the host restarts; the rest of the gateway keeps running. See System health.