r/MODBUS•
tscott8201

Modbus Master Options

Hi all. I’m new to MODBUS, but have a project here at work that requires it.

I’ve got a device in a substation that registers gas concentrations in oil. That device is capable of communicating via MODBUS over Ethernet. I need to poll the device, read data from its input registers and write those values to a database. So far I’ve acquired the device profile and configured a simple MODBUS tester installed on my local PC to read the input registers. So far so good.

What resources/software products are out there to create a master on my network server that will pull the needed data from the input registers and write it to a database on a set schedule?

Also, how does one covert the hex data from the register to a useful decimal value in a table?

Thanks in advance, Tom

Posted Mar 5, 2021, 2:57 PM UTC

42
CuleKameleon•

Hey,

Don't know whether the issue has been solved, but I will contribute what I know.

I would suggest to create your own MODBUS master with python using pymodbus, if its okay to use it in your work. You will have all the flexibility you want.

  1. It supports MODBUSTCP, MOODBUS-RTU & MODBUS-RTU over Ethernet.
  2. Pymodbus documentary is super elaborated.You can get read registers with single line codes like
    r = client.read_holding_register(address, no of regs, unit_id=slave_id) .
  3. Its Python - You can easily convert to any data type.
  4. Lot of scheduler modules available in python, you can easily schedule to poll the slaves.
  5. You did not mention which database you use, but python supports most of them if not all. Connecting and updating database is super-easy in python.

If you are planning to buy something, I don't think there will be a single product readily available which does both get-data from slave and update a database. Because there are tons of databases out there with different connection strings and writing algorithms and there won't be a single stop solution for all the requirements.
And if you do yourself via python, I think you may have to write around 25-35 lines of code for your requirement and that's it. Use Tkinter too for an okayish GUI.

1
tscott8201OP•

Great info, I appreciate it. We’re still doing our homework but this is definitely an option I like.

Tom

1