I am trying to connect to a temperature chamber via an Ethernet connection using pyVisa in Python. The device only allows connections through port 2049. I have no problems connecting to it via PuTTY or HyperTerminal, but when I try this command in Python
import visa
chamber = visa.instrument("TCPIP::10.2.17.130::2049")
I get this error:
VI_ERROR_RSRC_NFOUND: Insufficient location information or the requested device or resource is not present in the system
I know the device is there because I can talk through it in PuTTY, but I cannot seem to get the Python code to work. Any hints? Does pyvisa use SSH by default?
The simplest way (IMHO) to access a VISA resource is still by using the VISA device detection which would be through:
visa.ResourceManager().list_resources()
, if you're using pyVisa
viFindRsrc()
and viFindNext()
if you use the visa32.dll
library.Now by default, LAN connections are not detected using either method. This leaves you with two choices:
list_resources()
and viFindRsrc()
/viFindNext()
Actually, it's not always INSTR, depending on the resource class (see http://zone.ni.com/reference/en-XX/help/371361J-01/lvinstio/visa_resource_name_generic/).
Be sure to send byte strings to the instrument (especially if using Python 3+), otherwise you will get the following error:
VI_ERROR_RSRC_NFOUND: Insufficient location information or the requested device or resource is not present in the system
which can also be identified by 0xBFFF0011
or a return value of -1073807343
.