# Fieldbus configuration

> Fieldbus configuration: every key, its type and meaning, generated from the Go structs that decode it.

Product: eaxPLC · Type: Reference · Editions: Free
Source: https://eaxware.com/docs/eaxplc/reference/generated/config/fieldbus/
Verified against commit f67e38d.

<!-- GENERATED by tools/docgen (node tools/docgen/docgen.mjs). Do not edit by hand: change the source and regenerate. -->

The fieldbus configuration: buses (masters and scanners), their devices and the process-image I/O entries.

Keys are the JSON keys. **Optional** marks keys that are omitted when empty, or that may be absent (pointers).

## Config

Config is the whole fieldbus configuration.

Source: `eaxPLC/pkg/fieldbus/config.go`

| Key | Type | Optional | Description |
|---|---|---|---|
| `version` | integer |  |  |
| `buses` | list of [Bus](#bus) |  |  |

## Bus

Bus is one master/scanner and its devices.

Source: `eaxPLC/pkg/fieldbus/config.go`

| Key | Type | Optional | Description |
|---|---|---|---|
| `id` | string |  |  |
| `name` | string | yes |  |
| `type` | string |  |  |
| `enabled` | boolean |  |  |
| `local_ip` | string | yes | LocalIP: the network interface to use (EtherNet/IP binds its I/O port 2222 there; empty: all interfaces / the system's choice). |
| `interface` | string | yes | EtherCAT: the network interface dedicated to the line (e.g. eth1) and the cycle time (default 1000 us). |
| `cycle_us` | integer | yes |  |
| `bit_rate` | integer | yes | CANopen: Interface is the CAN port (can0: SocketCAN on Linux; slcan:COM5, slcan:/dev/ttyACM0, slcan:tcp://host:port: an SLCAN adapter or a serial device server; sim: virtual nodes in the runtime), the bit rate (default 500000), the SYNC period (default 10000 us) and the master's node id (0: none; 1..127: no node may use it, and the master produces its heartbeat every master_heartbeat_ms, default 100, for the nodes' heartbeat consumers). |
| `sync_us` | integer | yes |  |
| `master_node_id` | integer | yes |  |
| `master_heartbeat_ms` | integer | yes |  |
| `brokers` | list of string | yes | Brokers: tcp://, ssl:// (tls://, mqtts://), ws:// or wss:// URLs, tried in order; no user or password in a URL. A plaintext URL to anything but this computer is refused unless allow_plaintext, with a reason (the e-signed change carries it): on plaintext anyone on the path can inject PLC inputs. |
| `client_id` | string | yes | empty: eaxPLC-&lt;plc id&gt;-in |
| `username` | string | yes |  |
| `ca_pem` | string | yes |  |
| `cert_pem` | string | yes |  |
| `keepalive_sec` | integer | yes | default 5 (2..60) |
| `allow_plaintext` | boolean | yes |  |
| `plaintext_reason` | string | yes |  |
| `bus_max_msgs_per_sec` | integer | yes | Limits of the whole connection: messages per second (default 10000), the size of one payload (default 256 KiB) and the metrics of one Sparkplug payload (default 10000). Over them, messages are dropped and counted. |
| `max_payload_bytes` | integer | yes |  |
| `max_metrics` | integer | yes |  |
| `devices` | list of [Device](#device) |  |  |

## Device

Device is one field device (Modbus server, EtherNet/IP adapter).

Source: `eaxPLC/pkg/fieldbus/config.go`

| Key | Type | Optional | Description |
|---|---|---|---|
| `id` | string |  |  |
| `name` | string | yes |  |
| `enabled` | boolean |  |  |
| `host` | string |  |  |
| `port` | integer | yes | 502 / 44818 when 0 |
| `unit_id` | integer | yes | Modbus TCP |
| `poll_ms` | integer | yes | cycle time, default 100 |
| `timeout_ms` | integer | yes | per request, default 1000 |
| `rpi_ms` | number | yes | EtherNet/IP (Class 1) |
| `connection` | string | yes | exclusive_owner (default) \| input_only \| listen_only |
| `config_instance` | integer | yes |  |
| `input_instance` | integer | yes | T-&gt;O (produced by the adapter) |
| `output_instance` | integer | yes | O-&gt;T (or the heartbeat instance) |
| `input_size` | integer | yes | bytes, without the sequence count |
| `output_size` | integer | yes | bytes, without sequence count and run/idle header |
| `config_data` | string | yes | hex, sent with the Forward Open |
| `slot` | integer | yes | backplane slot (routes 1,&lt;slot&gt;); -1: no route |
| `timeout_multiplier` | integer | yes |  |
| `multicast` | boolean | yes | T-&gt;O multicast (default point-to-point) |
| `position` | integer | yes | EtherCAT: the slave's place in the line (1 = next to the master), the identity it must have (0: not checked); input_size / output_size are its process data bytes (from a bus scan). |
| `vendor_id` | integer | yes |  |
| `product_code` | integer | yes |  |
| `node_id` | integer | yes | CANopen: the node id; the identity it must have (vendor_id, product_code and revision, object 0x1018; 0: not checked); its heartbeat producer time (written to 0x1017, default 100 ms) and the consumer time after which the master declares it lost (default 3 x the producer time); how long the master waits for its boot-up message (default 5000 ms); its PDOs and the SDO writes of its boot sequence. input_size / output_size are derived from the TPDOs / RPDOs. The identity is checked on the other buses too: EtherCAT against the slave's SII (the revision per revision_check), EtherNet/IP as the Forward Open's electronic key (per electronic_key; revision is major*256 + minor there). |
| `revision` | integer | yes |  |
| `heartbeat_ms` | integer | yes |  |
| `heartbeat_timeout_ms` | integer | yes |  |
| `boot_timeout_ms` | integer | yes |  |
| `pdos` | list of [PDO](#pdo) | yes |  |
| `boot_sdos` | list of [SDOWrite](#sdowrite) | yes |  |
| `revision_check` | string | yes | RevisionCheck (EtherCAT, CANopen): off \| min (the device's revision is at least the configured one: a newer device replacing an older one starts) \| equal. Unset: off without a revision, min with one. |
| `electronic_key` | string | yes | ElectronicKey (EtherNet/IP): off (no key: any adapter answers) \| compatible (vendor and product must match; a compatible newer revision is accepted) \| exact (the revision too). Unset: compatible when vendor_id or product_code is set, else off. |
| `descriptor` | [Descriptor](#descriptor) | yes | Descriptor: the device description file imported for this device (identity, object dictionary or assemblies, process data), as parsed. |
| `inputs_on_fault` | string | yes | Behaviour |
| `outputs_on_stop` | string | yes | EtherNet/IP: idle (default) \| zero; Modbus: hold (default) \| zero; EtherCAT: zero (default) \| hold; CANopen: preop (default) \| zero |
| `status_address` | string | yes | optional %IX bit: TRUE while the device exchanges data |
| `source` | string | yes | sparkplug \| json |
| `group_id` | string | yes | Sparkplug B: the edge node (and one of its devices). |
| `edge_node_id` | string | yes |  |
| `device_id` | string | yes |  |
| `request_rebirth` | boolean | yes | RequestRebirth (D4, off by default): after a sequence gap or a value before any birth, send the node one "Node Control/Rebirth" command, at most once per 30 s, logged. |
| `topic_root` | string | yes | JSON: entries' topics are below TopicRoot. TimestampUnit of the payloads' "timestamp" (ns, ms or s: never guessed); EaxPLCJSON: the source is an eaxPLC publisher (ns). OnlineTopic: a topic saying whether the source is alive (false or 0: every entry comm failure). |
| `timestamp_unit` | string | yes |  |
| `eaxplc_json` | boolean | yes |  |
| `online_topic` | string | yes |  |
| `max_age_ms` | integer | yes | Defaults of the entries: max_age_ms (JSON: max_age_ms or online_topic is required; Sparkplug: 0, off), on_bad (hold). |
| `on_bad` | string | yes |  |
| `max_source_age_ms` | integer | yes | MaxSourceAgeMs: an update whose own timestamp is older than this on arrival is history only (Stale, 68); 0: off. |
| `max_msgs_per_sec` | integer | yes | MaxMsgsPerSec: this source's messages per second (default 1000). |
| `io` | list of [IOEntry](#ioentry) |  |  |

## PDO

PDO is one CANopen process data object of a node: a TPDO (the node
transmits; its data goes to %I) or an RPDO (the node receives; its data
comes from %Q), with its communication parameters and its mapping.

A node's input image is its TPDOs' data one after the other, in the
order configured, each taking its whole bytes; the output image is its
RPDOs' data the same way. I/O entries address these images by
byte\_offset / bit, like an EtherCAT slave's process data.

Source: `eaxPLC/pkg/fieldbus/canopen_config.go`

| Key | Type | Optional | Description |
|---|---|---|---|
| `direction` | string |  | tpdo \| rpdo |
| `number` | integer |  | 1..512 (communication object 0x1800/0x1400 + number - 1) |
| `cob_id` | integer | yes | COBID: 0 is the predefined connection set (PDO 1..4 only): TPDO 0x180/0x280/0x380/0x480 + node id, RPDO 0x200/0x300/0x400/0x500 + node id. |
| `transmission_type` | integer |  | TransmissionType: 0 acyclic synchronous, 1..240 every n-th SYNC, 254 / 255 event-driven (manufacturer / device profile). |
| `event_timer_ms` | integer | yes | TPDO 254/255: also sent every period |
| `entries` | list of [PDOMapEntry](#pdomapentry) |  |  |

## SDOWrite

SDOWrite is one SDO download of a node's boot sequence (written after
its PDOs, before its heartbeat time and NMT start).

Source: `eaxPLC/pkg/fieldbus/canopen_config.go`

| Key | Type | Optional | Description |
|---|---|---|---|
| `index` | integer |  |  |
| `sub` | integer |  |  |
| `data_type` | string |  | BOOLEAN, INTEGER8..64, UNSIGNED8..64, REAL32, REAL64, VISIBLE_STRING, OCTET_STRING (hex) |
| `value` | string |  |  |
| `name` | string | yes |  |

## Descriptor

Descriptor is an imported device description, as parsed: what the
configurator and the identity check need, not the whole file.

Source: `eaxPLC/pkg/fieldbus/descriptor.go`

| Key | Type | Optional | Description |
|---|---|---|---|
| `format` | string |  |  |
| `file_name` | string | yes |  |
| `sha256` | string |  |  |
| `identity` | [DescriptorIdentity](#descriptoridentity) |  |  |
| `objects` | list of [ODObject](#odobject) | yes | CANopen: the object dictionary's identity, PDO and mappable objects; the PDOs and boot SDOs a DCF / XDC configures (an EDS / XDD: its default PDO mapping); the node id and bit rate of a DCF / XDC. |
| `pdos` | list of [PDO](#pdo) | yes |  |
| `boot_sdos` | list of [SDOWrite](#sdowrite) | yes |  |
| `node_id` | integer | yes |  |
| `bit_rate` | integer | yes |  |
| `heartbeat_ms` | integer | yes | DCF / XDC: 0x1017 as configured |
| `ethercat_pdos` | list of [ECATPDO](#ecatpdo) | yes | EtherCAT: the PDOs (RxPDO outputs, TxPDO inputs) with their entries, the default assignment's process data sizes, and the CoE init commands (written at PS: information, the master does not run them yet). |
| `init_commands` | list of [ECATInitCmd](#ecatinitcmd) | yes |  |
| `assemblies` | list of [EIPAssembly](#eipassembly) | yes | EtherNet/IP: the assemblies and the connections the EDS declares. |
| `connections` | list of [EIPConnection](#eipconnection) | yes |  |
| `input_size` | integer | yes | Process data bytes (EtherCAT: the default PDOs; EtherNet/IP: the first exclusive owner connection). |
| `output_size` | integer | yes |  |
| `registers` | list of [IOEntry](#ioentry) | yes | Modbus register map: the I/O entries (without PLC addresses). |
| `warnings` | list of string | yes | Warnings: what was read but is not used, or was skipped. |

## IOEntry

IOEntry maps a range of a device's process data to the PLC.

Source: `eaxPLC/pkg/fieldbus/config.go`

| Key | Type | Optional | Description |
|---|---|---|---|
| `id` | string |  |  |
| `name` | string | yes |  |
| `direction` | string |  | in (device -&gt; %I) \| out (%Q -&gt; device) |
| `area` | string | yes | Modbus: coil \| discrete_input \| holding_register \| input_register, 0-based address |
| `address` | integer | yes |  |
| `byte_offset` | integer | yes | EtherNet/IP: offset in the assembly (and bit, for BOOL) |
| `bit` | integer | yes |  |
| `data_type` | string |  | BOOL SINT USINT BYTE INT UINT WORD DINT UDINT DWORD REAL |
| `count` | integer | yes | elements, default 1 |
| `word_order` | string | yes | Modbus 32-bit: ABCD (default, high word first) \| CDAB |
| `plc_address` | string |  | first element: %IX0.0, %IW4, %QD8 ... |
| `metric` | string | yes | Sparkplug: the metric name |
| `topic` | string | yes | JSON: below the source's topic_root |
| `quality_address` | string | yes | The entry's quality outputs, in %I: quality_address (%IX, TRUE only while Good: Uncertain and Stale are FALSE), status_address (%IB, the quality code), timestamp_address (%IL, the source's timestamp in Unix ms), age_address (%ID, ms since the last accepted update). |
| `status_address` | string | yes |  |
| `timestamp_address` | string | yes |  |
| `age_address` | string | yes |  |
| `on_bad` | string | yes |  |
| `substitute` | string | yes | a literal of the entry's type |
| `max_age_ms` | integer | yes | nil: the source's |

## PDOMapEntry

PDOMapEntry is one object mapped into a PDO (index, sub-index, length).

Source: `eaxPLC/pkg/fieldbus/canopen_config.go`

| Key | Type | Optional | Description |
|---|---|---|---|
| `index` | integer |  |  |
| `sub` | integer |  |  |
| `bits` | integer |  |  |
| `name` | string | yes |  |
| `data_type` | string | yes | the object's CANopen data type (information) |

## DescriptorIdentity

DescriptorIdentity is who the device is.

Source: `eaxPLC/pkg/fieldbus/descriptor.go`

| Key | Type | Optional | Description |
|---|---|---|---|
| `vendor_id` | integer | yes |  |
| `vendor_name` | string | yes |  |
| `product_code` | integer | yes |  |
| `product_name` | string | yes |  |
| `revision` | integer | yes |  |
| `order_code` | string | yes |  |
| `device_type` | integer | yes | CANopen 0x1000, EtherNet/IP product type |

## ODObject

ODObject is a CANopen object dictionary entry.

Source: `eaxPLC/pkg/fieldbus/descriptor.go`

| Key | Type | Optional | Description |
|---|---|---|---|
| `index` | integer |  |  |
| `sub` | integer |  |  |
| `name` | string |  |  |
| `data_type` | string |  | BOOLEAN, INTEGER8.., UNSIGNED8.., REAL32, VISIBLE_STRING ... |
| `bits` | integer | yes |  |
| `access` | string |  | ro, wo, rw, rwr, rww, const |
| `pdo_mapping` | boolean | yes |  |
| `default` | string | yes |  |
| `value` | string | yes | DCF ParameterValue / XDC actualValue |

## ECATPDO

ECATPDO is an EtherCAT PDO of an ESI.

Source: `eaxPLC/pkg/fieldbus/descriptor.go`

| Key | Type | Optional | Description |
|---|---|---|---|
| `direction` | string |  | rx (outputs) \| tx (inputs) |
| `index` | integer |  |  |
| `name` | string | yes |  |
| `sm` | integer |  | sync manager of the default assignment, -1: not assigned |
| `fixed` | boolean | yes |  |
| `mandatory` | boolean | yes |  |
| `entries` | list of [PDOMapEntry](#pdomapentry) |  |  |

## ECATInitCmd

ECATInitCmd is a CoE init command of an ESI.

Source: `eaxPLC/pkg/fieldbus/descriptor.go`

| Key | Type | Optional | Description |
|---|---|---|---|
| `transition` | string |  | PS, SO ... |
| `index` | integer |  |  |
| `sub` | integer |  |  |
| `data` | string |  | hex |
| `comment` | string | yes |  |

## EIPAssembly

EIPAssembly is an assembly an EtherNet/IP EDS declares.

Source: `eaxPLC/pkg/fieldbus/descriptor.go`

| Key | Type | Optional | Description |
|---|---|---|---|
| `key` | string |  | Assem100 |
| `name` | string | yes |  |
| `instance` | integer |  |  |
| `size` | integer |  | bytes, 0: variable / unknown |

## EIPConnection

EIPConnection is a Class 1 connection an EtherNet/IP EDS declares.

Source: `eaxPLC/pkg/fieldbus/descriptor.go`

| Key | Type | Optional | Description |
|---|---|---|---|
| `key` | string |  | Connection1 |
| `name` | string | yes |  |
| `type` | string |  | exclusive_owner \| input_only \| listen_only |
| `config_instance` | integer | yes |  |
| `output_instance` | integer | yes | O-&gt;T |
| `input_instance` | integer | yes | T-&gt;O |
| `output_size` | integer | yes |  |
| `input_size` | integer | yes |  |
| `rpi_ms` | number | yes |  |
