Exemplo n.º 1
0
    def __init__(self):
        SCPI.__init__(self, 'COM1', 'serial')
        #self.scpi_comm("SYST:REM")

        #self.scpi_comm("*RST")
        #self.scpi_comm("CLS")
        #self.scpi_comm("IDN?")
        self.ResetDevice()
        self.DeviceClear()
        self.scpi_comm("*CLS")
        self.ReadSoftwareVersion()
Exemplo n.º 2
0
    def __init__(self, resourceID, channel=1):
        self.resourceID = resourceID
        self.channelCount = channel
        try:
            self.resource = visa.ResourceManager().open_resource(resourceID)
        except BaseException as e:
            raise DeviceException('Error in open device ID: {}'.format(id), e)
        stp = SingleThreadProcessor()

        def stpQuery(*args):
            return stp.invokeAndWait(self.resource.query, *args)

        def stpWrite(*args):
            stp.invokeLater(self.resource.write, *args)

        self.scpi = SCPI(stpQuery, stpWrite)
        self.verifyIdentity()
Exemplo n.º 3
0
 def __init__(self, id):
     self.id = id
     self.rm = visa.ResourceManager().open_resource(id)
     self.scpi = SCPI(self.rm.query, self.rm.write)
Exemplo n.º 4
0
Arquivo: osc.py Projeto: wykys/HMO1002
parser_screenshot.add_argument('screenshot', action='store_true', help='save screenshot')
parser_screenshot.add_argument('-f', '--file', dest='file', action='store', default='img', help='image name, withtou siffix')
parser_screenshot.add_argument('-c', '--color', dest='color', action='store', default='color', choices=['color', 'gray', 'invert'], help='image colors')
parser_screenshot.add_argument('-d', '--date', dest='date', action='store_true', default=False, help='add the current date before the name')

# autoscale
parser_autoscale = subparsers.add_parser('autoscale', help='autoscale oscilloscope')
parser_autoscale.add_argument('autoscale', action='store_true', help='run autoscale')

# function generator
parser_fgen = subparsers.add_parser('fgen', help='function generator')
parser_fgen.add_argument('fgen', action='store_true', help='function generator')
parser_fgen.add_argument('-f', '--frequency', dest='freq', action='store', default='1000', help='output frequency')

args = parser.parse_args()

if 'screenshot' in args:
    if args.date:
        name = time.strftime('%Y.%m.%d-%H:%M:%S-', time.localtime()) + args.file
    else:
        name = args.file
    SCPI().screenshot(name=name, color=args.color)

elif 'autoscale' in args:
    SCPI().autoscale()

elif 'fgen' in args:
    SCPI().function_generator(freq=SI.si_to_exp(args.freq))
else:
    log.war('no any argument')
Exemplo n.º 5
0
 def __init__(self):
     SCPI.__init__(self,'/dev/usbtmc0','file')
Exemplo n.º 6
0
 def __init__(self,output):
     SCPI.__init__(self,'/dev/ttyACM0','serial')
     if not (output == 1 or output == 2):
         raise InterfaceOutOfBoundsError(output)
     else:
         self.output = str(output)