Logic Machine Forum
Modbus RTU - "Response not from selected slave" - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Gateway (https://forum.logicmachine.net/forumdisplay.php?fid=10)
+--- Thread: Modbus RTU - "Response not from selected slave" (/showthread.php?tid=1401)



Modbus RTU - "Response not from selected slave" - iJAF - 17.05.2018

Hello, I'm trying some integrations with Modbus RTU slaves.

I am simulating the slaves with Modbus Slave software and an usb rs485 converter to see the traffic between te Master and the Slave.

I am using the "RTU Read Test" option and I am observing a strange behaviour.

The telegrams are exchanged fine but I get "Response not from selected slave" !!

I tested with a cheaper usb converter from ebay and with the same traffic comunication the response is accepted !


[Image: rtu.png]

The traffic is the same ! the configurations are the same !

I'm not understanding why this don't work with my usb converter !

Any indea ?

Thank you


RE: Modbus RTU - "Response not from selected slave" - admin - 18.05.2018

Disable RTU port in mapper and use this script to show what LM sees during communication in Logs tab. Change port parameters, slave id and register address as needed.
Code:
require('luamodbus')
mb = luamodbus.rtu()

mb:open('/dev/RS485', 38400, 'E', 8, 1, 'H')
mb:connect()

buffer = {}
mb:setdebug(function(msg)
  buffer[ #buffer + 1 ] = msg
end)

mb:setslave(10)

mb:readregisters(1)

mb:close()

log(table.concat(buffer))



RE: Modbus RTU - "Response not from selected slave" - iJAF - 18.05.2018

(18.05.2018, 08:10)admin Wrote: Disable RTU port in mapper and use this script to show what LM sees during communication in Logs tab. Change port parameters, slave id and register address as needed.
Code:
require('luamodbus')
mb = luamodbus.rtu()

mb:open('/dev/RS485', 38400, 'E', 8, 1, 'H')
mb:connect()

buffer = {}
mb:setdebug(function(msg)
 buffer[ #buffer + 1 ] = msg
end)

mb:setslave(10)

mb:readregisters(1)

mb:close()

log(table.concat(buffer))

Hello, thank you for the feedback.

I have used your script and the frame received by the master is the same from Modbus Slave software Traffic log !

The result is here:

EDIT: The frame sent is the same, but the response from the slave is a bit strange, comparing with traffic log !

In those requests you can see an almost successful frame at 09:57:21.

There is a byte <FF> preceding the correct answer.

this is a bit strange !


RE: Modbus RTU - "Response not from selected slave" - admin - 18.05.2018

Do you have GND connected between RS-485 nodes? It seems that line is not put into idle state properly. Which adapters are you using?


RE: Modbus RTU - "Response not from selected slave" - iJAF - 18.05.2018

(18.05.2018, 09:43)admin Wrote: Do you have GND connected between RS-485 nodes? It seems that line is not put into idle state properly. Which adapters are you using?

I'm only using D1/D0 or A/B lines. Usually that is enough when I work with RS485 RTUs (PLCs, VFDs, Meters, Protections, etc).

My main converter is a TSXCUSB485 from Schneider Elec. This one, is the one that dows not work properly, from the printscreens above.
This is strange because this one works where all of the others fail.

The one that works fine is my second converter, one cheaper from ebay with the CH340 chip, that only has A/B terminals, no GND !

See here the Adapter

But i will try to add the GND line to see if there is any diference !

Thank you


RE: Modbus RTU - "Response not from selected slave" - admin - 18.05.2018

Have you tried changing polarization via on-board switch on TSXCUSB485?


RE: Modbus RTU - "Response not from selected slave" - iJAF - 18.05.2018

(18.05.2018, 10:26)admin Wrote: Have you tried changing polarization via on-board switch on TSXCUSB485?

Yes, first thing I have tried, but with no success. That was my first thought, the absence of pull up/pull down resistors in RS485 line spacelynk/LM.


But it is working now with ground connected like you have suggested !

I don't understand is why the cheaper from ebay works with only A/B and the bigger one form schneider don't Huh