IMDHMIControls LibraryShop main store

Explainer

What counts as a fieldbus instance in CODESYS licensing

Industrial networks Published 6 min read

Short answer

A master or controller in the CODESYS device tree is one fieldbus instance, no matter how many slaves it polls; a slave device the runtime serves counts one instance each. Modbus TCP demo operation stops after two hours with no reported connection or request caps. Control Standard S provides 4 instances, 1 of them complex; Standard L provides 2 complex instances.

On this page
  1. What the device tree counts
  2. One master is one instance, however many slaves it polls
  3. Serving as a slave counts per device
  4. Ordinary and complex instances
  5. Worked example: counting a mixed project
  6. The two-hour demo window
  7. Expiry stops a link; it does not refuse one
  8. Reading the count from the Software metrics tab
  9. The decisions
  10. Questions asked

In CODESYS application-based licensing, one master or controller in the device tree is one fieldbus instance, no matter how many slaves it polls, while a slave device the runtime serves counts one instance each. The store's application-based licensing FAQ states the rule in exactly those terms. The Modbus TCP Master in demo operation runs two hours from runtime start and then stops, and no connection-count or request-count cap is reported beyond that window. Count the tree, size the license to the count, and treat a failure that arrives well before the two-hour mark as a network fault rather than a licensing one.

What the device tree counts #

The unit of counting is the device configuration, not the application code. A ModbusFB ClientTCP block, a polling cycle, a socket that opens and closes — none of it enters the license arithmetic; only the device tree does. That is why the question 'does each client block count as one instance?' has a short answer: it does not. The master device the blocks reference counts, once, and everything the code does through it is free.

One master is one instance, however many slaves it polls #

A Modbus TCP Master device in the tree is one fieldbus instance. Poll one S7-1200 or poll fifty servers — drives, power meters, a remote gateway — the count stays at one, because the polled devices live under the master and are covered by its count. You can grow the poll list all season without touching the license.

Two master devices on one runtime are two instances, and a fieldbus gateway in the tree counts as an instance as well, with the CANopen Gateway the documented exception. Consolidation is therefore the lever: more servers under the existing master cost nothing, while a second master or a gateway costs one instance. If the master still has to be chosen, that decision comes first — how to select a CODESYS fieldbus master for industrial Ethernet covers the protocol and hardware side — and the counting here then tells you what it costs.

Serving as a slave counts per device #

The arithmetic flips when the runtime answers instead of asks. A slave device attached in the device tree — the configuration that makes your runtime the server — counts one instance each. One slave device at one address is one instance; three slave devices at three addresses are three instances. Both directions draw from the same instance total on the license, so a runtime that polls and serves pays for both.

Ordinary and complex instances #

Application-based runtime licenses bundle the counts, and two documented sizes bracket most projects. CODESYS Control Standard S ships with 512 total I/O channels, 4 fieldbus instances and 1 complex fieldbus instance, with EtherCAT named as the complex class. CODESYS Control Standard L is built for applications with two complex fieldbus instances and carries 4096 I/O channels. A Modbus TCP master lands in the ordinary count.

The license attaches to the runtime, not to the project: one license per runtime instance, one per controller or soft-PLC workstation that executes the application. For a pure Modbus project the complex allowance is irrelevant, so the instance count and the I/O channel count are the only two numbers that can push you off Standard S.

Worked example: counting a mixed project #

Take a virtual controller that polls twelve servers and also answers as a slave at three addresses:

Device-tree entry Role Instances
Modbus TCP Master, polling 12 servers (one S7-1200, nine drives, two power meters) Master 1
Modbus TCP Slave Device, address A Slave 1
Modbus TCP Slave Device, address B Slave 1
Modbus TCP Slave Device, address C Slave 1
Total 4

The arithmetic: 1 master + 3 slave devices = 4 instances, and the twelve polled servers contribute zero. Standard S provides 4 fieldbus instances, so the project fits it exactly, with 4 - 4 = 0 spare. Add one more master, one more slave device or a gateway, and the next size up is the answer. That is the whole sizing exercise for a Modbus-only project.

The two-hour demo window #

Demo operation is evaluation, not entitlement. The runtime logs it plainly — 'Demo mode for Modbus/TCP Master started. Will expire and stop!' — and the Modbus TCP Master then runs for 120 minutes from runtime start before the feature stops. A runtime restart opens a fresh 120-minute window.

Worked timing: a runtime started at 08:00 stops the master at 08:00 + 2 h = 10:00, and a session that begins at 09:15 has 120 min - 75 min = 45 min of master operation left. Beyond the window, nothing else is reported: field experience with the Modbus TCP master in demo agrees that no connection-count limit and no request-count limit appears. The same mechanism on the scanner side is why the CODESYS EtherNet/IP scanner runs in demo mode.

The decision: a bounded commissioning test against a physical server fits demo mode; continuous service does not. Never leave a running machine dependent on it — the stop at two hours drops the link without warning whatever reads it.

Keep the two failure modes apart, because the demo warning gets blamed for both. Expiry stops an exchange that was working, close to the 120-minute mark. A refusal is different: on Linux, socket error 111 means the connection attempt was actively rejected by a listener or a firewall, and it appears seconds after download, not two hours in. A failure at 09:55 after an 08:00 start is expiry; a failure twenty seconds after download is the network, the server or the namespace.

One trap is specific to containerized runtimes: a ping and a port-502 check that succeed on the Debian host prove host-side reachability only. The runtime inside Docker has its own network namespace, so repeat the TCP test from inside that context. When ping succeeds and the connection still fails immediately, the job becomes fixing a CODESYS communication error that appears while ping succeeds, not a licensing question.

Reading the count from the Software metrics tab #

Hand-counting a small tree is fine, but the IDE reports the number. The device editor carries a Software metrics tab used for license determination, and it lists the licensed software metrics of the project as configured for that device, fieldbus instances included. Open it after the last device edit and read the exact count instead of reconciling the tree by eye. The number sizes the license for that runtime target; it does not license the project file itself.

The decisions #

  • Polling only: one master device, any number of polled servers — 1 instance. A single-master Modbus project cannot exhaust Standard S on instances.
  • Runtime as server: one instance per slave device in the tree; three served addresses cost three.
  • EtherCAT-class master: draws on the complex allowance, not the ordinary count.
  • Mixed Modbus and EtherCAT: one Modbus TCP master plus one EtherCAT master fit Standard S together.
  • Validation: demo mode, one window per runtime start, restart between sessions; no connection or request caps reported.
  • Production: one license per runtime instance, sized from the Software metrics tab before ordering.

Questions asked

Do polled servers or client blocks add instances beyond the master?

No. Counting follows the device tree, not the code or the poll list: one Modbus TCP Master device is one instance whether it polls one server or fifty, and the ModbusFB blocks that use it add nothing. What does add instances is serving, where each slave device the runtime exposes counts one, and so does a second master device, even on a second network interface.

How long does the Modbus TCP Master keep running in demo mode?

Two hours from runtime start. The message log says it directly: 'Demo mode for Modbus/TCP Master started. Will expire and stop!' The feature stops when the window closes, and a runtime restart opens a new one. Nothing beyond the time limit is reported, with no connection-count or request-count cap appearing in demo operation.

Does an EtherCAT master count as a complex fieldbus instance?

Yes. EtherCAT draws on the complex allowance: CODESYS Control Standard S includes 4 fieldbus instances and allows 1 of them to be complex, while CODESYS Control Standard L is built around 2 complex instances with 4096 I/O channels. A Modbus TCP master stays in the ordinary count, so one EtherCAT master and one Modbus TCP master fit Standard S together.

Is the license per project or per controller?

Per runtime instance, meaning one license for each controller or soft-PLC workstation that executes the application. The project file is not what gets licensed, which is why the Software metrics tab is worth opening before ordering: it shows the instance count the selected runtime target needs, and switching the device lets you compare the same project against a smaller or larger tier.

Is demo mode enough to validate a virtual PLC against an S7-1200?

Yes, for a bounded test. The window is 120 minutes of continuous master operation from runtime start, with no reported connection or request caps, which is enough to commission reads, writes and fault checks against a physical server. Restart the runtime between sessions for a fresh window. A connection refused within the first minutes is a network or server fault, not the demo limit.

Keep reading

  • How-to

    Setting up a CODESYS Modbus TCP client to talk through a gateway

    In CODESYS, Modbus TCP is an application library, not a fieldbus add-on: reference the Modbus TCP Client SL library, point the client at the gateway's IP on port 502 with the gateway's unit ID, and split the map into contiguous blocks of at most 125 registers per request. Every value is a cached copy whose worst-case age is the gateway poll cycle plus your client's map refresh time, so budget both against the freshness the process needs.

    Industrial networks

  • How-to

    Set up a QJ71MT91 as Modbus TCP client with scattered registers

    Run the QJ71MT91 as a Modbus TCP client to the remote I/O interface on port 502, one connection at a time, and keep the SCADA host as a client of the module's server function. Split the slave's scattered register table into bounded requests grouped by object type and direction, convert references to zero-based offsets, and stage every network value in D registers instead of X and Y.

    Industrial networks

  • How-to

    Connecting third-party Modbus TCP devices to a Modicon MC80

    Yes. A Modicon MC80 under Control Expert Classic exchanges data with any third-party Modbus TCP device through explicit READ_VAR and WRITE_VAR calls plus the device's register map — there is no ESD or EDS import, no IO Scanning and no DTM support. Run the MC80 as the TCP client, keep the exchange in the coil and holding-register tables, and latch each result in the reader so a 16 ms update survives a slower PLC poll.

    Industrial networks