Forum

Notifications
Clear all

[Solved] Modbus TCP through a serial gateway, exception 0B or no reply from every slave

7 Posts
3 Users
0 Reactions
4 Views
(@wandak)
New Member
Joined: 2 years ago
Posts: 0
Topic starter   [#63]

Lift station upgrade. SCADA polls four Modbus TCP devices at the site over the radio link and they're no trouble at all. Behind a Moxa MGate serial gateway there are three RTU slaves on RS485, two chlorine analyzers and a flow meter, serial addresses 2, 3 and 4.

Anything through the gateway fails, either exception 0B, gateway target device failed to respond, or no reply at all. The gateway's web page shows the serial port TX blinking and no RX.

I checked the baud, 9600 8N1 on all three and matched on the gateway port, and I swapped A and B once and put them back. Do I need a different mode on the gateway, or is it an RS485 problem on the slave side? No RX at all on that port is the bit that bothers me, I'm not sure a wrong address would even get that far.


Advertisement

   
Quote
(@scott_m)
New Member
Joined: 1 year ago
Posts: 0
 

What unit ID is the driver sending to the gateway? It's per device in the SCADA driver settings. Default is 255 for some drivers, 1 for others, and what you poll at isn't what the gateway needs.



   
ReplyQuote
(@wandak)
New Member
Joined: 2 years ago
Posts: 0
Topic starter  

Left at the default, 255 I think. All three SCADA devices point at the gateway's IP, port 502, with different register addresses. I never set a unit ID on any of the direct TCP devices either and they work fine.



   
ReplyQuote
(@marcob)
New Member
Joined: 2 years ago
Posts: 0
 

255 is the problem. On most straight TCP devices the unit ID is decoration, they'll answer to anything. Through a serial gateway it's the only thing that says which slave on the RS485 side you want. 255 means slave 255, nobody's home, so the gateway sends it, TX blinks, it waits, and hands you 0B.

Set the unit ID per SCADA device to the slave's serial address: 2 for the first analyzer, 3 for the second, 4 for the flow meter. Same IP, same port, different unit ID. Register addresses stay as the manuals say, and watch 40001 versus 0, I've been bitten by that more than once. There's a writeup with the gateway bit here: https://plctr.com/understanding-the-communication-protocols-for-plc-and-scada-systems/



   
ReplyQuote
(@wandak)
New Member
Joined: 2 years ago
Posts: 0
Topic starter  

Unit IDs 2, 3, 4. Both analyzers read now and RX is blinking on the gateway. Flow meter still nothing, no exception either, the request just times out. its manual says address 4 and the DIP switches on the meter read 4.



   
ReplyQuote
(@scott_m)
New Member
Joined: 1 year ago
Posts: 0
 

What poll rate on the meter, and is its serial setting the same as the analyzers? A gateway port does one baud and parity for the whole RS485 chain. Check the meter's own menu, not the manual.



   
ReplyQuote
(@wandak)
New Member
Joined: 2 years ago
Posts: 0
Topic starter  

Meter was 8E1 from the factory and the analyzers 8N1, and the gateway port can only be one of those, so the meter never decoded a request at all. Set it to 8N1 on the keypad, all three read, 1000ms poll.

The unit ID left at 255 for everything behind the gateway was the real problem, and a unit ID matching each slave's serial address fixed it. The parity was a second problem hiding behind the first.

Still don't know why the gateway logged TX with no RX for the analyzers rather than some error before the unit ID change. Thanks marcob, scott_m.



   
ReplyQuote
Share: