Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VISA library path of simulated instrument #54

Open
juan-afc-ds opened this issue Aug 3, 2015 · 0 comments
Open

VISA library path of simulated instrument #54

juan-afc-ds opened this issue Aug 3, 2015 · 0 comments

Comments

@juan-afc-ds
Copy link

Hi,

I've set up a virtual environment for pythn 3.4.3 where I want to use Lantz. Given that I'm on a Debian-based distro right now, I can't trivially install the NI-VISA backend. Because of this, I've given pyvisa-py and pyvisa-sim a go. I'm going through the tutorials and I'm having problems understanding why I am getting an "OSError: Could not open VISA library." I've got to the point in the setup that if I launch in one terminal window:

lantz-sim fungen tcp

and then in another terminal I execute the script:

import visa
rm = visa.ResourceManager('@SiM')
rm.list_resources()

I get no output. I reckon this is good, because if do not launch "lantz-sim fungen tcp" I get the following error after execution of the script:

Traceback (most recent call last):
File "visa_test.py", line 3, in
rm = visa.ResourceManager()
File "/home/nomint/Documents/ProCon_FOSS/lantz_test/lib/python3.4/site-packages/pyvisa /highlevel.py", line 1488, in new
visa_library = open_visa_library(visa_library)
File "/home/nomint/Documents/ProCon_FOSS/lantz_test/lib/python3.4/site-packages/pyvisa /highlevel.py", line 1460, in open_visa_library
return cls(argument)
File "/home/nomint/Documents/ProCon_FOSS/lantz_test/lib/python3.4/site-packages/pyvisa/highlevel.py", line 96, in new
raise OSError('Could not open VISA library:\n' + '\n'.join(errs))
OSError: Could not open VISA library:

This makes sense to me. Yet, if I execute the following code found in the tutorials (with the funcgen simultaneously listening):

from lantz.drivers.examples import LantzSignalGenerator

inst = LantzSignalGenerator('TCPIP::localhost::5678::SOCKET')
inst.initialize()
print(inst.idn)
inst.finalize()

I get the error:
File "test_fungen.py", line 3, in
inst = LantzSignalGenerator('TCPIP::localhost::5678::SOCKET')
File "/home/nomint/Documents/ProCon_FOSS/lantz_test/lib/python3.4/site-packages/lantz/messagebased.py", line 296, in init
self.resource_manager = get_resource_manager()
File "/home/nomint/Documents/ProCon_FOSS/lantz_test/lib/python3.4/site-packages/lantz/messagebased.py", line 39, in get_resource_manager
_resource_manager = visa.ResourceManager()
File "/home/nomint/Documents/ProCon_FOSS/lantz_test/lib/python3.4/site-packages/pyvisa/highlevel.py", line 1488, in __new

visa_library = open_visa_library(visa_library)
File "/home/nomint/Documents/ProCon_FOSS/lantz_test/lib/python3.4/site-packages/pyvisa/highlevel.py", line 1460, in open_visa_library
return cls(argument)
File "/home/nomint/Documents/ProCon_FOSS/lantz_test/lib/python3.4/site-packages/pyvisa/highlevel.py", line 96, in new
raise OSError('Could not open VISA library:\n' + '\n'.join(errs))
OSError: Could not open VISA library:

I read the "configuring the NI backend" part of the docs, but I'm don't get how to apply that to my case. I have firstly no .pyvisarc file (I reckon I'd just have to create one à la .bashrc) and secondly (and most importantly) don't know where the libvisa is. I went through the pyvisa-py and pyvisa-sim folders and there are only py scripts, so dunno what I should point at. In the actual script there is no longer any '@SiM' argument, so I'm pretty lost right now.

I'd greatly appreciate any help. Looking heavily forward to trying out Lantz!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant