How to use the picoscope.ps6000 function in picoscope

To help you get started, we’ve selected a few picoscope examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github colinoflynn / pico-python / examples / sigGetBuiltIndemo.py View on Github external
"""
from __future__ import division

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

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

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

    # see page 13 of the manual to understand how to work this beast
    ps = ps6000.PS6000()

    print(ps.getAllUnitInfo())

    waveform_desired_duration = 1E-3
    obs_duration = 10 * waveform_desired_duration
    sampling_interval = obs_duration / 4096

    (actualSamplingInterval, nSamples, maxSamples) = ps.setSamplingInterval(
        sampling_interval, obs_duration)
    print("Sampling interval = %f ns" % (actualSamplingInterval * 1E9))
    print("Taking  samples = %d" % nSamples)
    print("Maximum samples = %d" % maxSamples)

    ps.setChannel('A', 'DC', 5.0, 0.0, True, False)
    ps.setSimpleTrigger('A', 0.0, 'Rising', delay=0, timeout_ms=100,
                        enabled=True)
github colinoflynn / pico-python / examples / specgram_plot.py View on Github external
def examplePS6000():
    fig = plt.figure()  # noqa
    plt.ion()
    plt.show()

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

    # Example of simple capture
    res = ps.setSamplingFrequency(250E6, 4096)
    sampleRate = res[0]  # noqa
    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() is False):
            time.sleep(0.01)

        print("Sampling Done")
        data = ps.getDataV("A", 4096)
github JohnDMcMaster / uvscada / fwpwr / ps6k_cap.py View on Github external
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()

    '''
    original settings
    20 ms/div
    100 Ms
    ch1
        +/- 1 V/div AC
        current probe
    ch3
       pin 28?
       shows clock like pattern
       gaps move around
github colinoflynn / pico-python / examples / dualview_time_fft.py View on Github external
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]
github colinoflynn / pico-python / examples / awgdemo.py View on Github external
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(__doc__)

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

    # see page 13 of the manual to understand how to work this beast
    ps = ps6000.PS6000()

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

    waveform_desired_duration = 1E-3
    obs_duration = 3 * waveform_desired_duration
    sampling_interval = obs_duration / 4096

    (actualSamplingInterval, nSamples, maxSamples) = \
        ps.setSamplingInterval(sampling_interval, obs_duration)
    print("Sampling interval = %f ns" % (actualSamplingInterval * 1E9))
    print("Taking  samples = %d" % nSamples)
    print("Maximum samples = %d" % maxSamples)

    waveformAmplitude = 1.5
    waveformOffset = 0
github JohnDMcMaster / uvscada / fwpwr / ps6k_cap.py View on Github external
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()

    '''
    original settings
    20 ms/div
    100 Ms
    ch1
        +/- 1 V/div AC
github colinoflynn / pico-python / examples / openUnitAsyncDemo.py View on Github external
On my computer, it takes 2.8 seconds to open the picoscope.
Maybe you want to do 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." %
          (time.time() - t_start))