Hello,
i want to controll a Lecroy Waverunner 8254M-MS via IVI Python and keep stucking right at the start. I just reentered python programming so dont be too harsh with me ;)
Visa, vxi11 and ivi is installed. And the controll form at the WR8254 is LXI (also tryed TCP)
Im Using Anaconda/Spyder with Python 3.6.4
I already tested the reachability of the scope via ActiveDSO and it worked well. But when im trying to use ivi i fail( meaybe im calling the constructor in the wrong way).
I added a Python File with the Class definition named lecroyWR8254M_MS (The file is attached). The File was added into the AppData\Local\Continuum\anaconda3\Lib path
Here*s the code:
from .lecroyWRXIA import *
from .lecroyWR104MXIA import *
class lecroyWR8254M_MS(lecroyWRXIA):
"Lecroy WaveRunner 8254M-MS IVI oscilloscope driver"
def __init__(self, *args, **kwargs):
self.__dict__.setdefault('_instrument_id', 'WR8254M-MS')
super(lecroy104MXiA, self).__init__(*args, **kwargs)
self._analog_channel_count = 4
self._digital_channel_count = 0
self._channel_count = self._analog_channel_count + self._digital_channel_count
self._bandwidth = 2.5e9
#self._memory_size = 64e6
self._init_channels()
I also manipulated the __init__.py which can also be found in the attatchment with the line:
from .lecroyWR8254M_MS import lecroyWR8254M_MS
Heres my Python code for initializing the Object:
import ivi
test_scope = ivi.lecroy.lecroyWR8254M_MS
test_scope.initialize("TCPIP::10.20.80.241::INSTR")
This leads to the follwing error message:
Traceback (most recent call last):
File "<ipython-input-135-926ede8d9bfc>", line 5, in <module>
test_scope.initialize("TCPIP::10.20.80.241::INSTR")
File "C:\Users\xxx\AppData\Local\Continuum\anaconda3\lib\site-packages\python_ivi-0.14.9-py3.6.egg\ivi\lecroy\lecroyBaseScope.py", line 451, in initialize
self._channel_count = self._analog_channel_count + self._digital_channel_count
AttributeError: 'str' object has no attribute '_analog_channel_count'
Another approach was to use a given class e.g. lecroyWR204MXIA just to verify that im calling the cunstructor the right way but it failed with the same error message.
I also tried to another object call with:
import ivi
test_scope = ivi.lecroy.lecroyWR8254M_MS("TCPIP::10.20.80.241::INSTR")
Thats the error output:
Traceback (most recent call last):
File "<ipython-input-145-4806bbf57b2e>", line 3, in <module>
test_scope = ivi.lecroy.lecroyWR8254M_MS("TCPIP::10.20.80.241::INSTR")
File "C:\Users\mdo\AppData\Local\Continuum\anaconda3\lib\site-packages\python_ivi-0.14.9-py3.6.egg\ivi\lecroy\lecroyWR8254M_MS.py", line 18, in __init__
super(lecroy104MXiA, self).__init__(*args, **kwargs)
NameError: name 'lecroy104MXiA' is not defined
Seems that something went wrong with the pass on with super() but i got no clue.
Can somebeody please give me a hint what im doing wrong i would be very thankfull.
Greeting
Matthias