-
-
Save bmjjr/0aecf74774b3959aafe760a2b7ba3eff to your computer and use it in GitHub Desktop.
Revisions
-
mobilinkd revised this gist
Sep 29, 2017 . 1 changed file with 6 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,9 @@ import visa, sys from pyvisa.constants import StatusCode from PIL import Image from cStringIO import StringIO def screendump(device, filename): rm = visa.ResourceManager('@py') @@ -14,7 +17,8 @@ def screendump(device, filename): 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() @@ -25,8 +29,7 @@ def screendump(device, filename): 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) -
mobilinkd created this gist
Jul 10, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ #!/usr/bin/env python import argparse import visa, sys from pyvisa.constants import StatusCode 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) open(filename, "w").write(data) 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)