pyModbusTCP icon indicating copy to clipboard operation
pyModbusTCP copied to clipboard

Device Identification objects

Open dunforda opened this issue 3 years ago • 2 comments

Thank you very much for your package. Is it possible to read the Device Identification information? E.g. serial number of TH probes etc.

Thank you,

dunforda avatar Sep 06 '22 00:09 dunforda

I tried copy/adapting read_holding_registers in client.py but it's obviously a bit more complicated than that ...

dunforda avatar Sep 06 '22 04:09 dunforda

This is now available in pyModbusTCP version 0.2.1.

from pyModbusTCP.client import ModbusClient

mc = ModbusClient(host='myserver.example.com')
dev_id_resp = mc.read_device_identification()
print(f'vendor={dev_id_resp.vendor_name}')

more: https://pymodbustcp.readthedocs.io/en/latest/package/class_ModbusClient.html#pyModbusTCP.client.ModbusClient.read_device_identification

sourceperl avatar Nov 21 '23 16:11 sourceperl