-
-
Save bmjjr/0aecf74774b3959aafe760a2b7ba3eff to your computer and use it in GitHub Desktop.
Screendump From Siglent DSO via VXI-11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import visa, sys | |
from pyvisa.constants import StatusCode | |
from PIL import Image | |
from cStringIO import StringIO | |
def screendump(device, filename): | |
rm = visa.ResourceManager('@py') | |
# Siglent SDS2204X | |
scope = rm.open_resource('TCPIP::%s' % device) | |
n, status = scope.write('SCDP') | |
if status == StatusCode.success: | |
scope.read_termination = None | |
data = scope.read_raw(2000000) | |
image = Image.open(StringIO(data)) | |
image.save(filename) | |
scope.close() | |
rm.close() | |
if __name__ == '__main__': | |
parser = argparse.ArgumentParser( | |
description='Grab a screenshot from a Siglent DSO.') | |
parser.add_argument('--output', '-o', dest='filename', required=True, | |
help='the output filename') | |
parser.add_argument('device', metavar='DEVICE', nargs=1, | |
help='the ip address or hostname of the DSO') | |
args = parser.parse_args() | |
screendump(args.device[0], args.filename) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment