title: Getting decoding errors when using the diag_message functions in the pyModbus library
body: <p>I'm attempting to use the diagnostic sub functions from the pyModbus library but I'm getting errors when decoding the response. This is handled by the pyModbus library and not my code so its hard to figure out where my problem is occurring. </p>
  
  <p>I referenced the documentation and tried the examples given here:
  <a href="https://pymodbus.readthedocs.io/en/latest/source/example/synchronous_client_ext.html" rel="nofollow noreferrer">https://pymodbus.readthedocs.io/en/latest/source/example/synchronous_client_ext.html</a></p>
  
  <p>The example below uses the function to get the NAK counts but I've tried it with multiple functions in the diag_messages library, including DiagnosticStatusSimpleRequest and ReturnQueryDataResponse.</p>
  
  <pre><code>from pymodbus.client.sync import ModbusTcpClient, ModbusSerialClient
  from pymodbus import diag_message
  
  ip = '10.130.14.176'
  
  with ModbusTcpClient(host=ip) as client:
      testRequest = client.read_holding_registers(3000, 1, unit=1) # test request to make sure the connection is working and the device is communicating. 
      print(testRequest.registers) # returns expected value
  
      rq = diag_message.ReturnSlaveNAKCountRequest(unit=1)
      rr = client.execute(rq)
      print(rr.isError) # get "Unable to decode request" error
  </code></pre>