Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #33031 > unrolled thread
| Started by | Jean Dubois <jeandubois314@gmail.com> |
|---|---|
| First post | 2012-11-09 08:19 -0800 |
| Last post | 2012-11-20 05:28 -0800 |
| Articles | 7 — 4 participants |
Back to article view | Back to comp.lang.python
[newbie] problem with module PyVisa Jean Dubois <jeandubois314@gmail.com> - 2012-11-09 08:19 -0800
Re: [newbie] problem with module PyVisa Rodrick Brown <rodrick.brown@gmail.com> - 2012-11-09 11:39 -0500
Re: problem with module PyVisa Jean Dubois <jeandubois314@gmail.com> - 2012-11-09 12:43 -0800
RE: problem with module PyVisa "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-11-09 21:16 +0000
Re: problem with module PyVisa wrw@mac.com - 2012-11-09 16:14 -0500
Re: problem with module PyVisa Jean Dubois <jeandubois314@gmail.com> - 2012-11-11 11:30 -0800
Re: problem with module PyVisa Jean Dubois <jeandubois314@gmail.com> - 2012-11-20 05:28 -0800
| From | Jean Dubois <jeandubois314@gmail.com> |
|---|---|
| Date | 2012-11-09 08:19 -0800 |
| Subject | [newbie] problem with module PyVisa |
| Message-ID | <2f065a8d-5cf6-455f-b559-d1b78d225fca@10g2000vbu.googlegroups.com> |
I'm trying to control a programmable power supply via USB using
python.
After doing some googling I thought I should use PyVisa for this
purpose, so I installed it as follows:
tar xvfz PyVISA-1.4.tar.gz
cd PyVISA-1.4
python setup.py install
Installation seems to finish without errors.
When I start a python session things go wrong as you can see in the
output below,
can anyone here tell me how to proceed correctly? thanks in advance.
>>> import visa
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/PyVISA-1.4-py2.6.egg/
visa.py", line 1, in <module>
from pyvisa.visa import *
File "/usr/local/lib/python2.6/dist-packages/PyVISA-1.4-py2.6.egg/
pyvisa/visa.py", line 231, in <module>
resource_manager = ResourceManager()
File "/usr/local/lib/python2.6/dist-packages/PyVISA-1.4-py2.6.egg/
pyvisa/vpp43.py", line 105, in __new__
it.init(*args, **kwds)
File "/usr/local/lib/python2.6/dist-packages/PyVISA-1.4-py2.6.egg/
pyvisa/visa.py", line 227, in init
self.session = self.vi = vpp43.open_default_resource_manager()
File "/usr/local/lib/python2.6/dist-packages/PyVISA-1.4-py2.6.egg/
pyvisa/vpp43.py", line 758, in open_default_resource_manager
visa_library().viOpenDefaultRM(byref(session))
File "/usr/local/lib/python2.6/dist-packages/PyVISA-1.4-py2.6.egg/
pyvisa/vpp43.py", line 175, in __call__
self.load_library()
File "/usr/local/lib/python2.6/dist-packages/PyVISA-1.4-py2.6.egg/
pyvisa/vpp43.py", line 146, in load_library
self.__lib = self.__cdecl_lib = cdll.LoadLibrary(path)
File "/usr/lib/python2.6/ctypes/__init__.py", line 431, in
LoadLibrary
return self._dlltype(name)
File "/usr/lib/python2.6/ctypes/__init__.py", line 353, in __init__
self._handle = _dlopen(self._name, mode)
OSError: /usr/local/vxipnp/linux/bin/libvisa.so.7: cannot open shared
object file: No such file or directory
[toc] | [next] | [standalone]
| From | Rodrick Brown <rodrick.brown@gmail.com> |
|---|---|
| Date | 2012-11-09 11:39 -0500 |
| Message-ID | <mailman.3500.1352479201.27098.python-list@python.org> |
| In reply to | #33031 |
It seems pretty obvious from the error. Try installing the missing lib packages. OSError: /usr/local/vxipnp/linux/bin/libvisa.so.7: cannot open shared object file: No such file or directory Sent from my iPhone On Nov 9, 2012, at 11:22 AM, Jean Dubois <jeandubois314@gmail.com> wrote: > OSError: /usr/local/vxipnp/linux/bin/libvisa.so.7: cannot open shared > object file: No such file or directory
[toc] | [prev] | [next] | [standalone]
| From | Jean Dubois <jeandubois314@gmail.com> |
|---|---|
| Date | 2012-11-09 12:43 -0800 |
| Subject | Re: problem with module PyVisa |
| Message-ID | <2325633a-640c-42f6-b8e7-930e475b7217@c20g2000vbz.googlegroups.com> |
| In reply to | #33033 |
On 9 nov, 17:40, Rodrick Brown <rodrick.br...@gmail.com> wrote: > It seems pretty obvious from the error. Try installing the missing lib packages. > > OSError: /usr/local/vxipnp/linux/bin/libvisa.so.7: cannot open shared > object file: No such file or directory > > Sent from my iPhone > > On Nov 9, 2012, at 11:22 AM, Jean Dubois <jeandubois...@gmail.com> wrote: > > > > > > > > > OSError: /usr/local/vxipnp/linux/bin/libvisa.so.7: cannot open shared > > object file: No such file or directory The error may be obvious but finding this file and how to install it is not unfortunately. It seems I have to install it from the National Instruments site but Debian Linux doesn't seem to be supported... and I doubt whether just copying this file will be sufficient to make PyVisa work. I wonder whether there might be another way to communicate via USB with a Keithley programmable power supply using Python. best regards, Jean
[toc] | [prev] | [next] | [standalone]
| From | "Prasad, Ramit" <ramit.prasad@jpmorgan.com> |
|---|---|
| Date | 2012-11-09 21:16 +0000 |
| Subject | RE: problem with module PyVisa |
| Message-ID | <mailman.3514.1352495808.27098.python-list@python.org> |
| In reply to | #33048 |
Jean Dubois wrote: > > On 9 nov, 17:40, Rodrick Brown <rodrick.br...@gmail.com> wrote: > > It seems pretty obvious from the error. Try installing the missing lib packages. > > > > OSError: /usr/local/vxipnp/linux/bin/libvisa.so.7: cannot open shared > > object file: No such file or directory > > > > Sent from my iPhone > > > > On Nov 9, 2012, at 11:22 AM, Jean Dubois <jeandubois...@gmail.com> wrote: > > > > > OSError: /usr/local/vxipnp/linux/bin/libvisa.so.7: cannot open shared > > > object file: No such file or directory > > The error may be obvious but finding this file and how to install it > is not unfortunately. > It seems I have to install it from the National Instruments site but > Debian Linux doesn't seem to be supported... > and I doubt whether just copying this file will be sufficient to make > PyVisa work. > I wonder whether there might be another way to communicate via USB > with a Keithley programmable power supply using Python. > Here are some reference links that might help. http://stackoverflow.com/questions/8140248/linux-implementation-of-visa-api https://decibel.ni.com/content/message/37590 Hope that helps, Ramit This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email.
[toc] | [prev] | [next] | [standalone]
| From | wrw@mac.com |
|---|---|
| Date | 2012-11-09 16:14 -0500 |
| Subject | Re: problem with module PyVisa |
| Message-ID | <mailman.3522.1352499267.27098.python-list@python.org> |
| In reply to | #33048 |
On Nov 9, 2012, at 3:43 PM, Jean Dubois <jeandubois314@gmail.com> wrote: > > The error may be obvious but finding this file and how to install it > is not unfortunately. > It seems I have to install it from the National Instruments site but > Debian Linux doesn't seem to be supported... > and I doubt whether just copying this file will be sufficient to make > PyVisa work. > I wonder whether there might be another way to communicate via USB > with a Keithley programmable power supply using Python. > > best regards, > Jean > > > > -- > http://mail.python.org/mailman/listinfo/python-list I've been using pyserial quite successfully to control a USB-to-serial converter. That is, controlling a couple of RS232 serial devices via the USB port through a KeySpan USB-to-Serial converter. Pyserial seems to make communication through the USB port quite transparent, at least on my OS-X system. -Bill
[toc] | [prev] | [next] | [standalone]
| From | Jean Dubois <jeandubois314@gmail.com> |
|---|---|
| Date | 2012-11-11 11:30 -0800 |
| Subject | Re: problem with module PyVisa |
| Message-ID | <cb58a60b-2f94-4c2b-83b0-923acf870127@o30g2000vbu.googlegroups.com> |
| In reply to | #33060 |
On 9 nov, 22:14, w...@mac.com wrote: > On Nov 9, 2012, at 3:43 PM, Jean Dubois <jeandubois...@gmail.com> wrote: > > > > > > > > > > > > > The error may be obvious but finding this file and how to install it > > is not unfortunately. > > It seems I have to install it from the National Instruments site but > > Debian Linux doesn't seem to be supported... > > and I doubt whether just copying this file will be sufficient to make > > PyVisa work. > > I wonder whether there might be another way to communicate via USB > > with a Keithley programmable power supply using Python. > > > best regards, > > Jean > > > -- > >http://mail.python.org/mailman/listinfo/python-list > > I've been using pyserial quite successfully to control a USB-to-serial converter. > > That is, controlling a couple of RS232 serial devices via the USB port through a KeySpan USB-to-Serial converter. > > Pyserial seems to make communication through the USB port quite transparent, at least on my OS-X system. > > -Bill Well, in fact I do have some working scripts using pyserial to control an older (and more expensive) Keithley sourcemeter in combination with a USB-to-serial converter. But the trouble started when buying a cheaper and newer Keithley model which does not have rs232 but only USB. I noticed they have put an extra layer above USB called USBTMC which complicates things further. I followed the instructions at http://www.home.agilent.com/upload/cmc_upload/All/usbtmc.htm?&cc=BE&lc=dut#3.Copyright%20Notice|outline and compiled and loaded the usbtmc-driver but I still can't communicate with the Keithley, hence I started looking for an alternative using PyVisa...and now I'm stuck jean
[toc] | [prev] | [next] | [standalone]
| From | Jean Dubois <jeandubois314@gmail.com> |
|---|---|
| Date | 2012-11-20 05:28 -0800 |
| Subject | Re: problem with module PyVisa |
| Message-ID | <9ee686ea-18f6-4782-9058-7cc2405b3be0@f17g2000vbz.googlegroups.com> |
| In reply to | #33142 |
On 11 nov, 20:30, Jean Dubois <jeandubois...@gmail.com> wrote:
> On 9 nov, 22:14, w...@mac.com wrote:
>
>
>
> > On Nov 9, 2012, at 3:43 PM, Jean Dubois <jeandubois...@gmail.com> wrote:
>
> > > The error may be obvious but finding this file and how to install it
> > > is not unfortunately.
> > > It seems I have to install it from the National Instruments site but
> > > Debian Linux doesn't seem to be supported...
> > > and I doubt whether just copying this file will be sufficient to make
> > > PyVisa work.
> > > I wonder whether there might be another way to communicate via USB
> > > with a Keithley programmable power supply using Python.
>
> > > best regards,
> > > Jean
>
> > > --
> > >http://mail.python.org/mailman/listinfo/python-list
>
> > I've been using pyserial quite successfully to control a USB-to-serial converter.
>
> > That is, controlling a couple of RS232 serial devices via the USB port through a KeySpan USB-to-Serial converter.
>
> > Pyserial seems to make communication through the USB port quite transparent, at least on my OS-X system.
>
> > -Bill
>
> Well, in fact I do have some working scripts using pyserial to control
> an older (and more expensive) Keithley sourcemeter in combination with
> a USB-to-serial converter.
> But the trouble started when buying a cheaper and newer Keithley model
> which does not have rs232 but only USB. I noticed they have put an
> extra layer above USB called USBTMC
> which complicates things further. I followed the instructions athttp://www.home.agilent.com/upload/cmc_upload/All/usbtmc.htm?&cc=BE&l...outline
> and compiled and loaded the usbtmc-driver but I still can't
> communicate with the Keithley, hence I started looking for an
> alternative using PyVisa...and now I'm stuck
>
> jean
I finally got it working without PyVisa as follows:
#!/usr/bin/python
#sample program for Keithley 2200 USB
#first compile and load module usbtmc
import os
usbkeith = open('/dev/usbtmc1','r+')
#next commando is very important
#without it you can fetch data but not SET data
usbkeith.write("SYST:REM" + "\n")
usbkeith.write("*IDN?\n")
identification=usbkeith.readline()
print 'Found: ',identification
usbkeith.write("SOUR:CURR 0.2A\n")
usbkeith.write("SOUR:OUTP:STAT ON\n")
usbkeith.write("MEAS:VOLT?\n")
measurement=usbkeith.readline()
print 'Measured voltage: ',measurement
regards,
jean
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web