Python IVI Lecroy Error while creating the Device Object

68 views
Skip to first unread message

Matze

unread,
May 25, 2020, 12:01:39 PM5/25/20
to python-ivi
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 ;)

I installed the guthub repository on https://github.com/python-ivi/python-ivi.

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
lecroyWR8254M_MS.py
__init__.py

Alex Forencich

unread,
May 25, 2020, 8:23:19 PM5/25/20
to pytho...@googlegroups.com

In the second case, I think that should be super(lecroyWR8254M_MS, ...)

Alex Forencich
--
You received this message because you are subscribed to the Google Groups "python-ivi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-ivi+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python-ivi/2c5c3d4a-c496-46b5-92a7-b0d0297561e4%40googlegroups.com.

Matze

unread,
May 26, 2020, 2:08:09 AM5/26/20
to python-ivi
Thanks Alex solved it :)
To unsubscribe from this group and stop receiving emails from it, send an email to pytho...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages