I'm trying to connect to a LeCroy Wavesurfer 400 series via their VICP VISA passport (TCP/IP) with PyVISA 1.7 under Windows7/32bit and NI-VISA 5.4.1:
import visa
rm = visa.ResourceManager()
scope = rm.open_resource("VICP::169.254.201.2::INSTR")
print(scope.query("*IDN?"))
I get the following error:
Warning (from warnings module): File "C:\Python27\lib\site-packages\pyvisa\ctwrapper\functions.py", line 1378 alias_if_exists)
VisaIOWarning: VI_WARN_EXT_FUNC_NIMPL (1073676457): The operation succeeded, but a lower level driver did not implement the extended functionality.
Traceback (most recent call last): File "C:\path\scopeTest.py", line 4, in scope = rm.open_resource("VICP::169.254.201.2::INSTR")
File "C:\Python27\lib\site-packages\pyvisa\highlevel.py", line 1614, in >open_resource info = self.resource_info(resource_name)
File "C:\Python27\lib\site-packages\pyvisa\highlevel.py", line 1584, in >resource_info
raise ValueError('Could not parse resource: %s (error code %s)' % >(resource_name, ret))
ValueError: Could not parse resource: VICP::169.254.201.2::INSTR (error code None)
Under LabVIEW connection to and communication with the device under this VICP address works. Also, when using TCPIP:: instead of VICP:: in open_resource() connection is established without warnings and errors and print(scope.ask("*IDN?")) works, but other device commands as scope.write("C1:VDIV .02") do not work
print(scope.query("C1:VDIV .02"))
WARNING : CURRENT REMOTE CONTROL INTERFACE IS TCPI
concluding that for correct device control the VICP passport has to be used. When using PyVISA 1.5 but otherwise same configuration and trying to connect via:
scope = visa.instrument("VICP::169.254.201.2::INSTR")
gives:
Warning (from warnings module): File "C:\Python27\lib\site-packages\pyvisa-1.5-py2.7.egg\pyvisa\ctwrapper\functions.py", line 1208 alias_if_exists)
VisaIOWarning: VI_WARN_EXT_FUNC_NIMPL (1073676457): The operation succeeded, but a lower level driver did not implement the extended functionality.
Warning (from warnings module):
File "C:\Python27\lib\site-packages\pyvisa-1.5-py2.7.egg\pyvisa\highlevel.py", line 315 return Instrument(resource_name, resource_manager=self, **kwargs)UserWarning: given resource was not an INSTR but Unknown
For earlier versions of PyVISA this was discussed for an empty string return of the instrument:
http://osdir.com/ml/python.pyvisa.devel/2007-07/msg00003.html
and
http://sourceforge.net/p/pyvisa/bugs/5/
I suspect the problem to be the InterfaceType in C:\Python27\lib\site-packages\pyvisa\constants.py not to exist for the VICP connection protocol in PyVISA. When resource_info(), the line that throws the error, in C:\Python27\lib\site-packages\pyvisa\highlevel.py is called
def resource_info(self, resource_name): """Get the extended information of a particular resource :param resource_name: Unique symbolic name of a resource. :rtype: :class:`pyvisa.highlevel.ResourceInfo` """ ret, err = self.visalib.parse_resource_extended(self.session, resource_name) if err == constants.StatusCode.success: return ret raise ValueError('Could not parse resource: %s (error code %s)' %(resource_name, ret))
seems to result in a mismatch with the interface_type, or might it be a problem with the resource_class and a return issue as with the older versions of PyVISA?