title: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed
body: <p>I try to connect my Power Analyser Rohde&amp;Schwarz, HMC8015 ('ASRL3::INSTR') to my computer, and to read any data that my device can show with python VISA. I have a lot of problems with the code line, which allows to read my device data.</p>
  
  <p>My code is:</p>
  
  <pre><code>import visa
  
  rm = visa.ResourceManager()
  name = rm.list_resources()
  
  #using with allows to close explicitly the resource at the end of the script
  with rm.open_resource('ASRL3::INSTR') as Power_Analyser:
  
      Power_Analyser.values_format.is_binary = True
      Power_Analyser.values_format.datatype = 'B'
      Power_Analyser.values_format.is_big_endian = False
      Power_Analyser.values_format.container = bytearray
  
      Power_Analyser.timeout = 25000 #2,5 seconds
  
      Power_Analyser.write_termination = '\n'
  
      Data = Power_Analyser.query_ascii_values('P?',datatype='s')[0]
      print(Data)
  
          #write the Data to a file on my PC
          PCfilePath = 'C:\\Users\\ApCha\\Documents\\Python Scripts\\a.txt'
          newFile = open(PCfilePath, "wb")
          newFile.write(Data)
          newFile.close()
  </code></pre>
  
  <p>It shows me: <code>VisaIOError: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed.</code></p>
  
  <p>No matter how big the timeout is set. I'm guessing that the problem comes from the syntax in
  <code>Power_Analyser.query_ascii_values('P?',datatype='s')[0]</code> but I can't figure out what's the correct syntax. </p>
  
  <p>I checked on my device manual:
  <a href="https://scdn.rohde-schwarz.com/ur/pws/dl_downloads/dl_common_library/dl_manuals/gb_1/h/hmc80115/HMC8015_SCPImanual_en_01.pdf" rel="nofollow noreferrer">https://scdn.rohde-schwarz.com/ur/pws/dl_downloads/dl_common_library/dl_manuals/gb_1/h/hmc80115/HMC8015_SCPImanual_en_01.pdf</a> </p>
  
  <p>but nothing seems to work and nothing is clearly explained for python VISA and I don't have any experience with that. Does anyone know how to fix the problem ?</p>