Closed ollie-campbell closed 1 year ago
minimalmodbus 2.0.2 does not exists (latest is 2.0.1), do you have some custom modifications?
Am I reading it correctly that the unit I am querying is responding from a different function code and minimalmodbus doesn't like it?
Yes
If the request is C9 10 00 C0 00 01 02 00 00 80 95
then the response should be C9 10 00 C0 00 01 11 BD
but your device responded with C9 01 00 A0 6E
(wrong function code, wrong response length)
Apologies 2.0.1, a mistype.
Ok thank you. I realise this isn't a bug issue now, but are you able to point me in a diagnosis direction? Something I can fire at the manufacturer for additional help.
Maybe the Modbus protocol specification https://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b3.pdf
Chapter 6.12 16 (0x10) Write Multiple registers
Thank you for your help so far. I have had a response from the manufacturers, who have given me Hex and binary to write to the device. Can I use this directly using minimalmodbus? Or is there a way I can 'convert' this to use it?
Examples from them are:
201 6 10753 78 C9 06 2A 01 00 4E 406E
Thanks again.
In your example, the function used is 06 Write Single Register
instrument.write_register(10753, 78, functioncode=6)
Great thank you once again.
Hi, I'm using minimalmodbus (2.0.2) to read data from a system connected to a Raspberry Pi over USB-to-serial convertor and it's working well. I would like to try and write data to it now, but am running into a problem.
When I read a register I get the following:
If I try to write value "0" to this register I get the following:
Am I reading it correctly that the unit I am querying is responding from a different function code and minimalmodbus doesn't like it?