python - PyVISA: cannot connect via VICP to LeCroy scope -


i'm trying connect lecroy wavesurfer 400 series via vicp visa passport (tcp/ip) pyvisa 1.7 under windows7/32bit , 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 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): operation succeeded, lower level driver did not implement 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: not parse resource: vicp::169.254.201.2::instr (error code none)

under labview connection , communication device under vicp address works. also, when using tcpip:: instead of vicp:: in open_resource() connection established without warnings , errors , print(scope.ask("*idn?")) works, other device commands scope.write("c1:vdiv .02") not work

print(scope.query("c1:vdiv .02")) warning : current remote control interface tcpi 

concluding correct device control vicp passport has used. when using pyvisa 1.5 otherwise same configuration , trying 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): operation succeeded, lower level driver did not implement 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 not instr unknown

for earlier versions of pyvisa discussed empty string return of instrument:

http://osdir.com/ml/python.pyvisa.devel/2007-07/msg00003.html
and
http://sourceforge.net/p/pyvisa/bugs/5/

i suspect problem interfacetype in c:\python27\lib\site-packages\pyvisa\constants.py not exist vicp connection protocol in pyvisa. when resource_info(), line throws error, in c:\python27\lib\site-packages\pyvisa\highlevel.py called

def resource_info(self, resource_name):          """get extended information of particular resource        :param resource_name: unique symbolic name of 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 result in mismatch interface_type, or might problem resource_class , return issue older versions of pyvisa?

apparently op did resolved, per https://github.com/hgrecco/pyvisa/issues/168. in thread, hgrecco (hernan grecco) says "i have implemented way force resource python class use."

the solution given there seems work me:

import visa pyvisa.resources import messagebasedresource rm = visa.resourcemanager() scope = rm.open_resource('vicp::192.168.1.109::instr', resource_pyclass=messagebasedresource) 

Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -