Modbus RTU RS485

G

Thread Starter

Gary Wilson

I am battling to connect a Siemens KTP700 Basic DP HMI panel directly to a Emerson UniDrive via Modbus RTU RS485. in the manuals both devices can talk Modbus RTU. The two devices do communicate, but the connection drops after a few seconds and there is some strange PLC address error. I am using baud-rate 19200b/s, no parity and 2 stop bits. I have used function code 4x. The parameter in the drive is 06.15 and the address in the HMI is 400615. My wiring is such; Drive pin 3 (0V) = HMI pin 5 (0V), Drive pin 2 (TX/RX+) = HMI pin 3 (TX/RX+), Drive pin 7 (TX/RX-) = HMI pin 8 (TX/RX-). What could I possibly be doing wrong? As I don't know Modbus well!
 
> "The two devices do communicate"
Do you actually successfully read or write a value? Or do the Tx/Rx LEDs blink? What constitutes 'communication' in the current state?

> "no parity and 2 stop bits"
A number of masters and slaves can't handle 2 stop bits, even though it's part of the Modbus serial spec.
I'd change to even parity one stop bit and see if that helps. If you change you need to do it on both ends.

> "some strange PLC address error"
It pays to look up the error code and find out what it is telling you.

> "address in the HMI is 400615"
a) Usually HMIs are the master, a drive is the slave.
Masters do not have register addresses, slaves have register addresses.
Is the Emerson drive really a master?

b) Some addressing starts at zero, others start at one (depends on model/vendor).
That means sometimes there's a one offset between the address/register provided and the address/register number the master uses when you set it up.
400615 could be 400614 or 400616, depending on which way the one offset happens.

> "function code 4x"
The master requests (using function code 03) data from addresses in the (4)xxxxx register range. The registers are in the slave.

Wiring looks correct, although there are vendors who label the (+) and (-) lines backwards. Backward connection will not damage the drivers, but it won't communicate.

My advice is to read single known values first, then multiple values, then do a single write.
 
Top