1

I have a modbus device and have connected a modbus RTU to ethernet converter ( and not modbus RTU to modbus TCP converter ).

All modules I have come across can read normal Modbus RTU, Modbus TCP, Modbus ASCII. But I haven't seen any module to read modbus through ethernet port.

When I tested using ModScan, I can see the data when I select Remote TELNET Server.

Is there a way I can read this data using python ??

10
  • You need more info on this "ethernet converter", basically, which protocol is used? Is it UDP or TCP based? Which port number is used? Commented Aug 13, 2018 at 12:35
  • The converter is TCP based. T've tried port 23, and 5001 Commented Aug 14, 2018 at 12:27
  • Protocol? (I understand it is NOT Modbus TCP). Any manual, part number? Commented Aug 14, 2018 at 12:53
  • @Ronaldo I'm using Moxa NPort 5110 (moxa.com/product/NPort_5110.htm). The website just says Serial-to-Ethernet Solution, so dont know much about how it's working Commented Aug 15, 2018 at 3:30
  • and I would like to read the data register-wise (in case tcp removes that format) as I have various parameters in diff registers I want to read Commented Aug 15, 2018 at 3:38

1 Answer 1

3

That's a common case, the devices are remote serial/tcp converters. MOXA has tons of then.

You should understand that:

  • 'modbus rtu' - this is serial modbus, contains data+crc16
  • 'modbus tcp' - this is TcpHeader[6 bytes] + data.
  • 'modbus rtu over tcp' - this is YOUR case.

Standard modbus tcp/rtu converting devices change not only physics (ethernet/rs485 eg) but also protocol itself, removing tcp header and adding crc.

Simple serial/tcp converters (like you have) do not modify protocol.

You can use your lovely PyModbus after you manually specify rtu-framer for tcp-client.

client = ModbusClient('localhost', port=5020, framer=ModbusRtuFramer)

https://pymodbus.readthedocs.io/en/latest/source/example/synchronous_client.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.