IMDHMIControls LibraryShop main store

Explainer

CP 443-1 Modbus TCP server limit and the FB108 call pattern

Industrial networks Published 7 min read

Short answer

Yes — with the S7-OPENMODBUS/TCP V5.x package (2XV9450-1MB00) in STEP 7 V5.5 SP4, one CP 443-1 polls several Modbus TCP servers: one NetPro TCP connection and one FB108 instance DB per server. The ceiling is the CP's documented 64-connection total minus every connection it already carries, or the package's stated connection count if that is lower.

On this page
  1. One connection and one instance DB per server
  2. Where the limit sits
  3. Worked example: counting the budget
  4. The call pattern for several servers
  5. Bring one server up, then add the rest
  6. Faults that recur with several servers online
  7. Verify the client on the wire
  8. Questions asked

Yes — one CP 443-1 in an S7-400 polls several Modbus TCP servers, through the S7-OPENMODBUS/TCP V5.x package (order number 2XV9450-1MB00) in a STEP 7 V5.5 SP4 project. The pattern is fixed: one TCP connection configured in NetPro per server, and one FB108 instance DB per server, with the next job on an instance triggered only after the previous one has finished. The ceiling is a number you can work out on paper: the CP's documented connection total minus every connection it already carries for S7, HMI and other traffic, or the package documentation's own connection count, whichever is lower. Below is that count, the call pattern for several servers, the bring-up order, and the faults that appear once more than a couple of servers are online.

One connection and one instance DB per server #

FB108 drives one TCP connection, and that pairing is the whole design. The connection lives in NetPro, where it gets its connection ID, the server's IP address, remote port 502, and the S7 side set as the active partner. The instance DB belongs to one call and holds that job's state — trigger, status and the data being moved — so two servers cannot share an instance DB without corrupting each other's jobs, and two servers cannot share one connection because the connection is what identifies the partner.

The block works asynchronously: the CP moves the telegram outside the scan, so the call must be processed every cycle from OB1 or another cyclic OB, and the outputs report completion several cycles after the trigger. The Modbus specification frames each exchange with an MBAP header — transaction identifier, protocol identifier, length and unit identifier — before the function code and data, and the reply carries the same transaction identifier with protocol identifier 0. That per-transaction matching is another reason the instance state cannot be shared: the block keeps request and reply apart per connection and per instance. Servers listen on TCP port 502 unless the device documentation defines another port.

Where the limit sits #

The CP 443-1 operating manual caps the interface at 64 connections in total across S7, ISO-on-TCP, TCP, UDP and PROFINET IO, depending on firmware. The manual's example splits that budget as 7 S7 connections, 2 ISO-on-TCP connections and 25 TCP connections, with the remainder left for other services. The ceiling for Modbus TCP servers is therefore that total minus everything already configured on the CP — S7 links, HMI connections, any other TCP or UDP service.

Read the figures for your exact CP order number and firmware rather than carrying one across variants: the EX30-variant documentation, for example, lists at most 30 SEND/RECV connections per CPU 412/414 and 62 per CPU 416/417, because the mode-specific counts depend on the CPU type. The package documentation states its own connection count; the working limit is whichever of the two is smaller. And keep the budgets apart: these figures are the CP's, not the CPU's integrated PN port's, whose own mixed-protocol limit is covered in whether one S7 CPU PN port can run Modbus TCP and S7 comms together.

Worked example: counting the budget #

An S7-400 rack with one CP 443-1 carries, in NetPro, 10 S7 connections — engineering station, two partner PLCs, the process control links — and 6 connections to operator stations. That is 10 + 6 = 16 connections in use, so 64 - 16 = 48 remain. The client can therefore poll up to 48 Modbus TCP servers directly: 48 NetPro TCP connections and 48 FB108 instance DBs, one pair per server.

If the plant needs 60 servers, the budget is 12 short. Group the serial devices behind Modbus gateways instead: each gateway takes one TCP connection and fronts, in this example, 20 serial slaves selected by unit identifier, so 3 gateways take 3 connections, cover all 60 devices and leave 45 connections spare. The price is refresh time — a gateway answers one request at a time, so one round over its slaves takes the slave count multiplied by the per-request time. Scheduling those requests round-robin is the same problem as how to poll many Modbus RTU slaves from one serial master. Decide the gateway count from the required refresh time, then confirm it fits the remaining connections.

The call pattern for several servers #

Copy FB108 with its dependent blocks from the package library into the project's block folder and resolve any block-number conflicts with existing project blocks before compiling. Then write one call per server in a cyclic OB: the first call uses its instance DB and the connection ID of server A's NetPro connection, the second uses a second instance DB and server B's connection ID, and so on. The inputs carry the job trigger, the connection ID, function code, start address, quantity and the data area; the outputs return done, busy, error and a status code. Those names and data types belong to the FB108 interface as the package version defines it — open the interface in SIMATIC Manager and use its names, not ones reconstructed from another project. If the package installation includes a V5.x example project, copy its call and adapt the connection ID and instance DB; otherwise build the call from the interface.

Call every instance unconditionally each scan. The CP moves the telegram asynchronously, so done arrives cycles after the trigger, and the next job on the same instance must wait for done or error. A trigger that fires while the instance is still busy is the classic cause of intermittent error status that shows up only when two servers are polled in the same scan.

Bring one server up, then add the rest #

  1. Install the package and copy FB108 with its dependent blocks from the library into the project's block folder; resolve block-number conflicts before compiling.
  2. In HW Config, set the CP 443-1's IP address and subnet mask on the same subnet as the servers, or define the router between them; save and compile.
  3. In NetPro, add a TCP connection from the CPU to an unspecified partner, set the S7 side as the active partner, enter the server's IP address and remote port 502, then save and compile the network.
  4. Download the hardware configuration and the connections to the CPU and confirm the connection shows established in NetPro diagnostics. The download interrupts the CP's running communication until it completes, so bring the first server up in a maintenance window.
  5. Create one instance DB and program the FB108 call as a short read of a holding register with a known value; download the blocks.
  6. Trigger the job: done set, error clear, and the received value equal to the server's value once the addressing rule below is applied.
  7. Add the remaining servers one at a time — one NetPro connection plus one instance DB each — repeating the checks for each, then run every job concurrently for several minutes while watching the CPU diagnostic buffer and the scan time.

Faults that recur with several servers online #

Symptom Usual cause Check
Values shifted by one register Wire addresses are zero-based; device manuals often print 1-based 4xxxx notation Read a register with a known value and compare
32-bit values or floats garbled Word order differs between devices; the S7 stores big-endian bytes within each word Swap the word pair and re-read the known value
Exception reply instead of data Unsupported function code, address out of range, wrong unit identifier Read the exception code in the reply frame
A connection never establishes Subnet mismatch, the server closes idle sockets, or the server accepts one client session only Ping the server from the engineering PC, then compare NetPro connection status
Intermittent error status on one server A job triggered while the previous job on that instance was still busy Gate the next trigger on done or error

Verify the client on the wire #

  • Ping each server from the engineering PC: replies, no loss.
  • NetPro connection status per server: established, no error.
  • A read of a known register: done set, error clear, value matches after the addressing rule.
  • A protocol analyzer capture on one server: request and reply with matching transaction identifier, protocol identifier 0, the intended unit identifier and function code.
  • All jobs running concurrently for several minutes: no error status on any instance, stable scan time, clean diagnostic buffer.

The decision, per case: up to the free connection count on the CP, poll each server directly with its own NetPro connection and FB108 instance DB; beyond it, group serial devices behind gateways at one connection each and size the gateway count from the refresh time the process needs.

Questions asked

Does Modbus TCP over a CP 443-1 use the CPU's own PN port budget?

No. With a CP 443-1 in the rack, the Modbus TCP traffic and its connections sit on the CP, so the CP's connection cap applies and the CPU's integrated PN interface is not part of the count. Keep the two budgets separate when the same rack also communicates through the PN port, because that port runs its own mixed-protocol limit.

Can one TCP connection serve several serial slaves behind a gateway?

Yes. The gateway takes one NetPro TCP connection and each slave is selected by the unit identifier in the request. A gateway answers one request at a time, so the round time grows with the slave count: at an example 10 ms per request, 20 slaves take about 200 ms per full round. Size the number of gateways from the required refresh time, not from the connection budget.

Does register 40001 mean wire address 40001?

No. The address in the request frame is zero-based, so 40001 in a device manual usually maps to offset 0 of the holding registers. Device documentation is not uniform about its notation, so read one register with a known value and confirm the offset before any batch of jobs goes live.

Which package, CP and STEP 7 combination is the released one?

The setup described here is S7-OPENMODBUS/TCP V5.x, order number 2XV9450-1MB00, on a CP 443-1 in a STEP 7 V5.5 SP4 project. The release notes shipped with the package state the released combinations of package version, CP and STEP 7 service pack; match them before writing code, because the package version fixes the FB108 block set and its interface.

Where do the FB108 input and output names come from?

From the FB108 interface in the installed package library. Copy the block with its dependent blocks into the project, open the interface in SIMATIC Manager and use the names and data types exactly as that package release defines them; they are not generic and can change between releases. The roles stay stable: job trigger, connection ID, function code, start address, quantity and data area in; done, busy, error and status out.

Keep reading

  • Troubleshooting

    Why an HMI Modbus TCP write leaves the S7-1200 DB unchanged

    The write most likely never reached the register you think it did: the HMI's 400001 is a one-based display number, while the Modbus request carries a zero-based offset that the server block maps onto DB102.DBW0. Confirm the server block status and data area, confirm station 3 points at the S7-1200 rather than the motion controller, match the driver's register convention, and prove the path with one known value written to a single word.

    Industrial networks

  • How-to

    Linking Modbus RTU BMS SCADA to a redundant S7-1500R

    Use one Modbus RTU-to-TCP gateway as the Modbus TCP client, and run the Modbus TCP server on the S7-1500R system IP address that switched communication moves to the surviving CPU. The BMS keeps polling its RS-485 link unchanged; on a switchover the TCP session drops and the gateway reconnects. Set the comm-fail timeout to the measured gap plus one poll interval: 3 s at a 1 s rate in the example.

    Industrial networks

  • Explainer

    What counts as a fieldbus instance in CODESYS licensing

    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.

    Industrial networks