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

AssertionError in get_data method #2

Open
lsi8 opened this issue Mar 2, 2021 · 0 comments
Open

AssertionError in get_data method #2

lsi8 opened this issue Mar 2, 2021 · 0 comments

Comments

@lsi8
Copy link

lsi8 commented Mar 2, 2021

When running your example:

import pyvisa as visa
from Rigol1000z import Rigol1000z
from time import sleep
from Rigol1000z.constants import *

# Initialize the visa resource manager
rm = visa.ResourceManager()

# Get the first visa device connected
osc_resource = rm.open_resource(rm.list_resources()[0])

# Create oscilloscope interface using with statement!
with Rigol1000z(osc_resource) as osc:
    osc.ieee488.reset()  # start with known state by restoring default settings

    # osc.autoscale()  # Autoscale the scope

    # Set the horizontal timebase
    osc.timebase.mode = ETimebaseMode.Main  # Set the timebase mode to main (normal operation)
    osc.timebase.scale = 10 * 10 ** -6  # Set the timebase scale

    # Go through each channel
    for i in range(1, 5):
        osc[i].enabled = True  # Enable the channel
        osc[i].scale_v = 1000e-3  # Change voltage range of the channel to 1.0V/div.

    osc.run()  # Run the scope if not already
    sleep(0.5)  # Let scope collect the waveform

    osc.stop()  # Stop the scope in order to collect data.

    osc.get_screenshot('./screenshot.png')  # Take a screenshot of the scope's display

    osc.get_data(EWaveformMode.Raw, './channels.csv')  # Collect and save waveform data from all enabled channels

    osc.run()  # Move back to run mode when data collection is complete

I get the following error:
/usr/local/lib/python3.7/dist-packages/pyvisa_py/protocols/usbtmc.py:116: UserWarning: Unexpected MsgID format. Consider updating the device's firmware. See https://github.com/pyvisa/pyvisa-py/issues/20 "Unexpected MsgID format. Consider updating the device's firmware. See https://github.com/pyvisa/pyvisa-py/issues/20" Reset can take several seconds to complete Reset complete Traceback (most recent call last): File "/home/pi/Documents/projects/cu/pnaci/rigol/testu3.py", line 76, in <module> osc.get_data(EWaveformMode.Raw, './channels.csv') # Collect and save waveform data from all enabled channels File "/home/pi/.local/lib/python3.7/site-packages/Rigol1000z/rigol1000z.py", line 241, in get_data assert mode in {EWaveformMode.Normal, EWaveformMode.Raw} AssertionError

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