IMDHMIControls LibraryShop main store

How-to

Configuring S7-317F Modbus TCP to a Eurotherm 3504

Industrial networks Published 6 min read By IMDHMI controls team

Short answer

Use the ModbusTCP PN CPU package, order number 2XV9450-1MB02, with the S7-317F PN/DP as Modbus client and the Eurotherm 3504 as server over its integrated PN/IE interface. The MODBUSPN block, which calls TCON, TSEND and TRCV internally, runs one request-and-complete handshake at a time. Bring up a read of a monitoring value first and add writes only after a live value agrees.

Two compact PLCs on a DIN rail, each patched by a network lead into a small Ethernet switch mounted above them
On this page
  1. Roles, port and the block set
  2. What to verify before programming
  3. Network setup with worked addresses
  4. Program the first read handshake
  5. Reading the failure layer
  6. First write test
  7. The decision for each outcome
  8. Questions asked

Yes, this link works with the ModbusTCP PN CPU package, order number 2XV9450-1MB02, on the S7-317F PN/DP. Set the PLC as the Modbus client and the Eurotherm 3504 as the server: both reads and writes travel over that one relationship, with every transaction initiated by the PLC. The block you program is MODBUSPN, which calls TCON, TSEND and TRCV internally, so you never manage the TCP socket yourself. You run one request-and-complete handshake at a time. Bring up a read of a monitoring value first, and add a write only after a live value on the PLC matches the controller display.

Roles, port and the block set #

Modbus TCP is the Modbus application protocol carried over TCP, and the server listens on the well-known port 502 assigned to it. The governing document is the Modbus Messaging on TCP/IP Implementation Guide; in practice it requires the client to open one TCP connection to the server, send a request carrying a function code, and wait for the matching response on that same connection. The client is the device that requests; the server answers. A PLC read pulls the process value from the 3504, and a PLC write pushes a setpoint to it, and both fit the single client-to-server connection, so neither device has to change role.

Inside the package, MODBUSPN wraps the transport: TCON establishes the connection, TSEND puts the request on the wire, and TRCV collects the response, and the block maps the payload into PLC memory and reports execution status to your program.

What to verify before programming #

  1. Confirm the communications option fitted to the 3504 supports Modbus TCP. Check it against the 3504/3508 Engineering Manual, HA027988 Iss 19. An Ethernet connector on the unit alone does not prove Modbus TCP support.
  2. Compare the complete CPU order number, firmware version and engineering software version against the compatibility list for 2XV9450-1MB02. The supported combination must appear there; blocks from another CPU family are not interchangeable.
  3. From the documentation installed with the package, identify the configuration wizard, the communication blocks, their supporting blocks and the instance data, and keep them as one matched set from a single package revision.
  4. Build an exchange list before writing code: for each variable, its register address in the controller map, read or write permission, data type, register count, the PLC address that holds the value, and how often it must update.

Network setup with worked addresses #

Give both endpoints unique addresses on a common subnet. Example addresses, not prescriptions: PLC at 192.168.1.10 and the 3504 at 192.168.1.50, both with mask 255.255.255.0. The check is a binary AND of each address with the mask: 192.168.1.10 AND 255.255.255.0 gives 192.168.1.0, and 192.168.1.50 AND 255.255.255.0 also gives 192.168.1.0. Identical results mean the two devices are on the same subnet, so no gateway sits in the path and a direct cable or one switch carries the traffic.

Then configure the controller side. Set the 3504 communications option to Modbus TCP server operation as its manual describes, and record the endpoint it listens on. Run the package wizard in the engineering software: select the CPU's integrated PN/IE interface, enter the controller's address and port, plus any remote identification the package documentation calls for. Because the same interface also carries PROFINET traffic, this works the same way as described for why Modbus TCP and PROFINET I/O can share one interface.

Program the first read handshake #

  1. Copy the package blocks and the instance data block into the project exactly as the supplied example shows, then compile. A clean compile confirms no missing dependencies or conflicting connection resources.
  2. Call MODBUSPN following the example's pattern: one initialization pass, then a cyclic call in the main program.
  3. Choose the first transaction: one documented monitoring value such as the process variable, read with function code 3 for holding registers or 4 for input registers as the register table states, with the register count matching the value's width.
  4. Raise the request input, keep every request parameter and the transmit data unchanged while the transaction runs, and wait for the done or error output.
  5. Reset the request before starting the next transaction on the same MODBUSPN instance. One transaction at a time per instance is the rule; queue the remaining variables from your exchange list behind the first.
  6. Compare the received value with the controller display, allowing for its display rounding.

Resolve the address convention before entering any register number. Manuals often list registers by table reference while the request carries the protocol address, and the two can differ by an offset. Take the convention from the package interface and the controller register table together; shifting every address by one without that check produces valid responses carrying the wrong variable.

Reading the failure layer #

Keep the layers apart when a transaction fails. A link LED proves the Ethernet interfaces connected, not that the 3504 accepts Modbus requests; an open TCP connection proves the endpoint answered, not that a register address is valid.

Observed condition Deciding layer Decision
No Ethernet link Cabling or interface Check the cable, switch port and the fitted communications option
Link up, no TCP connection IP configuration or server state Verify addresses, mask, port and that the server is enabled
Connection up, request errors Modbus transaction Read the block status and the returned exception; check function code, address and access rights
Read completes, value wrong Mapping Check register address convention, scaling, sign and word order
Read works, write rejected Register permission or mode Confirm the register is writable and the function code is 6 or 16 as the map requires

First write test #

Choose a writable variable from the register table and a test value the process owner has approved. Write it with function code 6 for a single register or 16 for multiple registers, then read the same register back in a separate transaction and confirm the accepted value. Do not write a setpoint into a live control loop without that approval; the loop must be in a state where a changed setpoint is harmless. The server-side settings that decide whether a write lands are the same ones covered in what you must configure on the PLC side for Modbus TCP when the roles are reversed, and the client-side handshake is the same discipline as configuring an R16CPU as a Modbus TCP master in GX Works3 on a different platform.

The decision for each outcome #

  • Read agrees with the display: the mapping is proven; add the remaining reads, then the writes, one transaction at a time.
  • Link but no connection: it is IP, port or server enablement, not your program.
  • Connection but an exception: it is the function code, address or access right of that one request; the block status tells you which request failed.
  • Correct transaction, wrong number: it is scaling, word order or the address offset, and the register table settles it.

Questions asked

Can the Eurotherm 3504 initiate the requests instead of the PLC?

Keep the PLC as the client. The package is built for PLC-initiated traffic through MODBUSPN, and both directions of data fit the one client/server connection, so reversing the roles gains nothing. A 3504 in server mode needs no polling logic and answers each request within its own scan, while the update rate on the PLC side follows your scan cycle and response timeout.

Does Modbus TCP traffic disturb PROFINET I/O on the same PN interface?

No. Cyclic PROFINET I/O frames and the Modbus TCP connection are separate traffic types and both run over the integrated PN/IE interface. MODBUSPN opens its own TCP connection alongside the I/O connections. Count that connection against the CPU's documented connection resources when the project also carries many other connections, and keep the Modbus polling interval modest so the interface load stays predictable.

How many registers can one read request fetch?

The Modbus specification allows a function code 3 or 4 read to return up to 125 registers, each 16 bits. Read only registers the 3504 register table documents as one contiguous block. A single process value typically occupies one register, while a 32-bit value occupies two and needs the word order the manual specifies. Reading fewer registers per request than the maximum keeps the response short and the transaction fast.

Why does the PLC value differ from the controller display by a factor of ten?

The register carries an integer with implied decimal places. A display of 250.0 degrees can be transmitted as the integer 2500 with one implied decimal, so the PLC must divide by ten before showing engineering units. Take the scaling, the sign convention and the register count from the 3504 register table rather than guessing, and apply the same conversion in reverse before writing a setpoint.

Keep reading

  • Explainer

    Multiplexing Modbus TCP clients on an S7-410H PN interface

    Yes — an S7-410H can multiplex one Modbus TCP connection resource across successive servers on its integrated PN interface: use the redundant Modbus/TCP library built for that interface, set DISCONNECT to release the current server, then load the next partner's configuration and reconnect, and never call TCON or TDISCON yourself because the Modbus block owns them. Each polled server must accept two simultaneous TCP sessions, and the sequential round time must fit each device's data age.

    Industrial networks

  • How-to

    Connect an S7-1500 to Modbus TCP in TIA Portal

    Modbus TCPIP is Modbus TCP: Modbus frames carried over TCP on Ethernet, listening on port 502. On an S7-1500 you connect by calling MB_CLIENT over the integrated PROFINET port in TIA Portal. Choose client or server by which side initiates the request; most connections to an older system need the PLC as client.

    Industrial networks

  • Explainer

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

    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.

    Industrial networks