title: Python: Connect device using Visa TCP Socket connection
body: <p>In summary; I am trying to connect to a device using Visa TCP Socket option.</p>
  <p>The Connection does not complain but I can not run any SCPI command to the device. Could this be because of an incorrect port number? =&gt; [Updated on 08/01/2021] No, 5025 is the correct port number, verified with the user manual. Still the error occurs.</p>
  <p>Sample code in use:</p>
  <pre><code>import pyvisa as visa
  import socket
  
  try:
    resourceManager = visa.ResourceManager() 
    dev = 'TCPIP0::192.168.0.44::5025::SOCKET'
    session = resourceManager.open_resource(dev)
    print('\n Open Successful!')
    print('IDN:' +str(session.query('*IDN?')))
  
  except Exception as e:
    print('[!] Exception:' +str(e))
  </code></pre>
  <p>I get the below response:
  <a href="https://i.stack.imgur.com/JP4bj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JP4bj.png" alt="enter image description here" /></a></p>
  <p>Thanks in advance!
  P.S. I had no issues with GPIB, USB or other TCPIP connections.</p>