I'm trying to write values above 1000 using the minimalmodbus library, but my code generates the following error:
Traceback (most recent call last):
File "D:/Projetos/ON/HMI/modbus_tk_test.py", line 19, in <module>
instrument.write_register(38, 1001)
File "D:\Projetos\ON\HMI\venv\lib\site-packages\minimalmodbus.py", line 511, in write_register
self._generic_command(
File "D:\Projetos\ON\HMI\venv\lib\site-packages\minimalmodbus.py", line 1177, in _generic_command
payload_from_slave = self._perform_command(functioncode, payload_to_slave)
File "D:\Projetos\ON\HMI\venv\lib\site-packages\minimalmodbus.py", line 1250, in _perform_command
payload_from_slave = _extract_payload(
File "D:\Projetos\ON\HMI\venv\lib\site-packages\minimalmodbus.py", line 1776, in _extract_payload
_check_response_slaveerrorcode(response)
File "D:\Projetos\ON\HMI\venv\lib\site-packages\minimalmodbus.py", line 3436, in _check_response_slaveerrorcode
raise error
minimalmodbus.IllegalRequestError: Slave reported illegal data value
If I use values below 1001 no error is generated. Here is my code:
I'm trying to write values above 1000 using the minimalmodbus library, but my code generates the following error:
If I use values below 1001 no error is generated. Here is my code:
Any help is appreciated.