Esempio n. 1
0
    def __init__(self, parent=None, console=None, showScriptParameter=None):
        super(PicoScopeInterface, self).__init__(parent)
        self.parent = parent
        self.scopetype = None
        self.datapoints = []

        scope_cons = {}

        scope_cons["PS6000"] = ps6000.PS6000(connect=False)
        scope_cons["PS5000a"] = ps5000a.PS5000a(connect=False)
        scope_cons["PS2000"] = ps2000.PS2000(connect=False)
        defscope = scope_cons["PS5000a"]

        self.advancedSettings = None

        scopeParams = [
            {
                'name': 'Scope Type',
                'type': 'list',
                'values': scope_cons,
                'value': defscope,
                'set': self.setCurrentScope
            },
        ]

        self.params = Parameter.create(name='PicoScope Interface',
                                       type='group',
                                       children=scopeParams)
        ExtendedParameter.setupExtended(self.params, self)
        self.showScriptParameter = showScriptParameter
        self.setCurrentScope(defscope)
Esempio n. 2
0
def setupScope():
    ps = ps6000.PS6000()

    #Example of simple capture
    res = ps.setSamplingFrequency(500E6, 4096)
    sampleRate = res[0]
    print "Sampling @ %f MHz, %d samples" % (res[0] / 1E6, res[1])
    ps.setChannel("A", "AC", 50E-3)
    return [ps, sampleRate]
Esempio n. 3
0
def examplePS6000():

    fig = plt.figure()
    plt.ion()
    plt.show()

    print "Attempting to open..."
    ps = ps6000.PS6000()

    #Example of simple capture
    res = ps.setSamplingFrequency(250E6, 4096)
    sampleRate = res[0]
    print "Sampling @ %f MHz, %d samples" % (res[0] / 1E6, res[1])
    ps.setChannel("A", "AC", 50E-3)

    blockdata = np.array(0)

    for i in range(0, 50):
        ps.runBlock()
        while (ps.isReady() == False):
            time.sleep(0.01)

        print "Sampling Done"
        data = ps.getDataV("A", 4096)
        blockdata = np.append(blockdata, data)

        ##Simple FFT
        #print "FFT In Progress"
        #[freqs, FFTdb] = fft(data, res[0])
        #plt.clf()
        #plt.plot(freqs, FFTdb)
        #plt.draw()

        start = (i - 5) * 4096
        if start < 0:
            start = 0
        #Spectrum Graph, keeps growing
        plt.clf()
        plt.specgram(blockdata[start:], NFFT=4096, Fs=res[0], noverlap=512)
        plt.xlabel('Measurement #')
        plt.ylabel('Frequency (Hz)')
        plt.draw()

    ps.close()
Esempio n. 4
0
from picoscope import ps6000
from picoscope import picobase
import matplotlib.pyplot as plt
import numpy as np
import time
import os.path

ps = ps6000.PS6000(serialNumber=None, connect=True)

################## Starts up the signal generator on the Picoscope #############

#pktopk: set the peak to peak voltage in microvolts

"""
pktopk = 2
siggen = picobase._PicoscopeBase.setSigGenBuiltInSimple(ps,offsetVoltage=0,
                                pkToPk=pktopk, waveType="Square",
                                frequency=10E2, shots=10000, triggerType="Rising",
                                triggerSource="None", stopFreq=None,
                                increment=10.0, dwellTime=1E-1, sweepType="Up",
                                numSweeps=2)



ps.setChannel(channel="A", coupling="AC", VRange=5) #Trying a VOffset to increase resolution
ps.setChannel(channel="B", coupling="AC", VRange=5)
ps.setChannel(channel="C", coupling="AC", VRange=5)
ps.setChannel(channel="D", enabled=False)

"""
Esempio n. 5
0
File: test3.py Progetto: ufwt/icfuzz
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals

import time
from picoscope import ps6000
import pylab as plt
import numpy as np

if __name__ == "__main__":
    print("Checking for devices")
    ps = ps6000.PS6000(connect=False)
    allSerialNumbers = ps.enumerateUnits()
    assert len(allSerialNumbers) == 1, "Device not found"
    serial = allSerialNumbers[0]
    print("Connecting to PS6000 %s" % serial)
    ps = ps6000.PS6000(serial)

    print("Found the following picoscope:")
    print(ps.getAllUnitInfo())
    print()

    '''
    waveform_desired_duration = 50E-6
    obs_duration = 3 * waveform_desired_duration
    sampling_interval = obs_duration / 4096
    '''
    sampling_interval = 1e-6
    # in seconds
    obs_duration = 0.025
Esempio n. 6
0
something useful with it :D.

"""

from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals

import time
from picoscope import ps6000

if __name__ == "__main__":
    print(__doc__)

    ps = ps6000.PS6000(connect=False)

    print("Attempting to open Picoscope 6000...")

    ps.openUnitAsync()

    t_start = time.time()
    while True:
        (progress, completed) = ps.openUnitProgress()
        print("T = %f, Progress = %d, Completed = %d" %
              (time.time() - t_start, progress, completed))
        if completed == 1:
            break
        time.sleep(0.01)

    print("Completed opening the scope in %f seconds." %
Esempio n. 7
0
By: Mark Harfouche

"""

from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals

from picoscope import ps6000

# import the garbage collection interface
import gc

if __name__ == "__main__":
    ps = ps6000.PS6000()

    print("Found the following picoscope:")
    print("Serial: " + ps.getUnitInfo("BatchAndSerial"))

    pd = ps

    print("Copied the picoscope object, the information of the copied object is:")
    print("Serial: " + pd.getUnitInfo("BatchAndSerial"))

    print("\n\n\n")

    print("Using both objects")
    ps.setChannel('A')
    pd.setChannel('B')
 def __init__(self):
     PicoScopeBase.__init__(self, ps6000.PS6000(connect=False))