Use the PLC 304 as two independent Modbus endpoints: a Modbus RTU master on the P1 RS-232/485 port and a Modbus TCP slave on Ethernet. The operator panel remains the Modbus TCP master. Configure and verify each communication path separately before linking serial data to Ethernet variables.
Define the Communication Architecture
| Connection | Master | Slave | Protocol and interface |
|---|---|---|---|
| Field I/O polling | PLC 304 | Discrete and analog acquisition modules or TRM 202 | Modbus RTU over RS-485 through P1 |
| Operator-panel polling | Weinnek panel | PLC 304 | Modbus TCP over LAN |
This arrangement requires the PLC application to place values received from serial slaves into variables exposed by the Ethernet Modbus TCP slave.
Configure the PLC as a Modbus TCP Slave
- Add an Ethernet device to the PLC project.
- Add a Modbus TCP slave beneath the Ethernet device.
- Bind the required PLC variables to the slave's Modbus data areas.
- Configure the panel as a Modbus TCP master and map its requests to those data areas.
Treat input and output register memory as separate areas. Reading the same numerical register with Modbus function 3 and function 4 can therefore return different data. Match the panel's function selection to the area used by each bound PLC variable.
Configure P1 for Modbus RTU Master Polling
- Select the RS-485 interface on P1 and configure the PLC as the Modbus master.
- For every slave, obtain its register table and required serial framing from that device's manual.
- Create read or write requests for the documented slave addresses and map the returned data to PLC variables.
- For a TRM 202, use the register table at the end of its manual and apply its fixed RTU stop-bit setting. The evidence does not state the stop-bit value, so confirm it in that manual rather than assuming one.
The available evidence does not provide baud rate, parity, slave addresses, register offsets, or data types. Configure those values from the manuals for the installed devices. If the standard Modbus facility cannot implement a required exchange, the application can open the serial port, construct requests, and decode replies, but this requires explicit implementation of Modbus framing and response parsing.
Verify Data Across Both Links
First confirm that the PLC receives changing values from each RS-485 slave and that each response is assigned to the intended PLC variable. Then inspect the bound Modbus TCP areas and poll them from the panel. If the panel returns an unexpected value, compare the requested register area and function: function 3 and function 4 do not address the same PLC memory area even when their numerical register values match.
Do not troubleshoot both links as one transaction. A valid panel-to-PLC TCP exchange does not prove that P1 polling works, and a valid RTU response does not prove that the value has been bound to the correct TCP register area.
FAQ
Can a PLC 304 poll Modbus RTU devices while an HMI polls it over Modbus TCP?
Yes. Configure the PLC as the RTU master on P1 RS-485 and as the Modbus TCP slave on Ethernet; configure the panel as the TCP master.
Why do Modbus functions 3 and 4 return different PLC 304 values for the same register number?
The Modbus TCP slave separates input and output register memory. Select the function that corresponds to the data area where the PLC variable is bound.
How do I poll a TRM 202 from a PLC 304?
Build the RTU requests from the TRM 202 register table and configure its documented fixed stop-bit setting. Confirm the actual stop-bit value, baud rate, parity, address, and register definitions in the device manual.