PicoScope 7 Software
Available on Windows, Mac and Linux
Code: Select all
from picosdk.ps2000 import ps2000
from picosdk.functions import assert_pico2000_ok, adc2mV
from picosdk.PicoDeviceEnums import picoEnum
with ps2000.open_unit() as device:
print('Device info: {}'.format(device.info))
res = ps2000.ps2000_set_sig_gen_built_in(
device.handle,
1000_000, # offset voltage in uV
2000_000, # peak-to-peak voltage in uV
0, # type of waveform (0 = sine wave)
20000.0, # start frequency in Hz
20000.0, # stop frequency in Hz
0.0, # frequency change per interval in Hz
0.1, # interval of frequency change in seconds
0, # sweep direction (0 = up)
1_000 # number of times to sweep
)
assert_pico2000_ok(res)
Code: Select all
ps2000.ps2000_run_streaming_ns
Code: Select all
import matplotlib.pyplot as plt
import numpy as np
from picosdk.ps2000 import ps2000
from picosdk.functions import assert_pico2000_ok
from picosdk.PicoDeviceEnums import picoEnum
with ps2000.open_unit() as device:
print('Device info: {}'.format(device.info))
res = ps2000.ps2000_set_sig_gen_built_in(
device.handle,
1000_000, # offset voltage in uV
2000_000, # peak-to-peak voltage in uV
0, # type of waveform (0 = sine wave)
20000.0, # start frequency in Hz
20000.0, # stop frequency in Hz
0.0, # frequency change per interval in Hz
0.1, # interval of frequency change in seconds
0, # sweep direction (0 = up)
1_000 # number of times to sweep
)
assert_pico2000_ok(res)
res = ps2000.ps2000_run_streaming_ns(
device.handle,
500,
2,
100_000,
False,
1,
50_000
)
assert_pico2000_ok(res)
fig, ax = plt.subplots()
plt.show()