title: Minimalmodbus Illegal Address
body: <p>I am new to the modbus and I am trying minimalmodbus library for python. I have a device connected and trying the examples provided by the minimalmobus documentation I get the following error:</p>
  <pre><code>MinimalModbus debug mode. Create serial port COM13
  MinimalModbus debug mode. Will write to instrument (expecting 7 bytes back): 01 03 00 04 00 01 C5 CB (8 bytes)
  MinimalModbus debug mode. Clearing serial buffers for port COM13
  MinimalModbus debug mode. No sleep required before write. Time since previous read: 7361796.00 ms, minimum silent period: 1.75 ms.
  MinimalModbus debug mode. Closing port COM13
  MinimalModbus debug mode. Response from instrument: 01 83 02 C0 F1 (5 bytes), roundtrip time: 30.0 ms. Timeout for reading: 0.0 ms.
  
  Traceback (most recent call last):
    File &quot;k.py&quot;, line 15, in &lt;module&gt;
      r=instrument.read_register(4,1,functioncode=3)
    File &quot;C:\Users\Themistoklis\AppData\Local\Programs\Python\Python36-32\lib\site-packages\minimalmodbus.py&quot;, line 486, in read_register
      payloadformat=_Payloadformat.REGISTER,
    File &quot;C:\Users\Themistoklis\AppData\Local\Programs\Python\Python36-32\lib\site-packages\minimalmodbus.py&quot;, line 1245, in _generic_command
      payload_from_slave = self._perform_command(functioncode, payload_to_slave)
    File &quot;C:\Users\Themistoklis\AppData\Local\Programs\Python\Python36-32\lib\site-packages\minimalmodbus.py&quot;, line 1330, in _perform_command
      response, self.address, self.mode, functioncode
    File &quot;C:\Users\Themistoklis\AppData\Local\Programs\Python\Python36-32\lib\site-packages\minimalmodbus.py&quot;, line 1880, in _extract_payload
      _check_response_slaveerrorcode(response)
    File &quot;C:\Users\Themistoklis\AppData\Local\Programs\Python\Python36-32\lib\site-packages\minimalmodbus.py&quot;, line 3538, in _check_response_slaveerrorcode
      raise error
  minimalmodbus.IllegalRequestError: Slave reported illegal data address
  </code></pre>
  <p>My code is a simple one which follows the examples provided</p>
  <pre><code>import minimalmodbus
  import serial
  
  instrument = minimalmodbus.Instrument('COM13',1,debug=True)
  
  instrument.serial.baudrate=115200
  instrument.serial.parity=serial.PARITY_EVEN
  
  print(instrument.read_register(4,1,functioncode=3))
  
  instrument.serial.close()
  </code></pre>
  <p>I know that the register number 4 is a good one since when I use a Labview example provided with the device I get a reading from that. I would appreciate it if anyone can provide me with some more in depth info about the errors of minimalmodbus and what do they exactly mean.</p>