コード例 #1
0
import time

import pylab

from PyHT6022.HTSDKScope import Oscilloscope


if __name__ == "__main__":
    scope0 = Oscilloscope(scopeid=0)
    if not scope0.is_attached():
        print("WARNING: Scope not found!")
        exit()
    scope0.set_voltage_division(1, 5)
    print(scope0.set_sampling_rate(26))
    scope0.setup_dso_cal_level()
    pylab.ion()
    length = 1000
    for i in range(10):
        data = scope0.read_data_from_scope(data_points=3000)
        tIndex = data[3].value
        pylab.plot(data[2][:length], data[0][tIndex:tIndex + length])  # , 'r-')
        pylab.draw()
        time.sleep(1)
コード例 #2
0
import StringIO
import sys

from PyHT6022.HTSDKScope import Oscilloscope


scope = Oscilloscope()
scope_channel = 1
if not scope.is_attached():
    print "No scope detected! Check connection!"
    sys.exit(1)
print "Setting up scope!"
# TODO: Are all these extra calls for setup needed?
scope.set_voltage_division(100, 200)
scope.set_voltage_division(1, 6)
scope.set_sampling_rate(500)
samplerate = 1000 * 1000
scope.set_sampling_rate(24)
scope.setup_dso_cal_level()
cal_level = scope.get_calibration_data()
scope.set_dso_calibration(cal_level)

data = []
total = 0

print "Reading data from scope!"
for x in range(0, 10):
    print x
    data.append(scope.read_data_from_scope(1047550, raw_data=True)[scope_channel-1])
    total += len(data[x])
コード例 #3
0
import time

import pylab

from PyHT6022.HTSDKScope import Oscilloscope

if __name__ == "__main__":
    scope0 = Oscilloscope(scopeid=0)
    if not scope0.is_attached():
        print "WARNING: Scope not found!"
        exit()
    scope0.set_voltage_division(1, 5)
    print scope0.set_sampling_rate(26)
    scope0.setup_dso_cal_level()
    pylab.ion()
    length = 1000
    for i in xrange(0, 10):
        data = scope0.read_data_from_scope(data_points=3000)
        tIndex = data[3].value
        pylab.plot(data[2][:length],
                   data[0][tIndex:tIndex + length])  # , 'r-')
        pylab.draw()
        time.sleep(1)
コード例 #4
0
from struct import pack
import StringIO
import sys

from PyHT6022.HTSDKScope import Oscilloscope

scope = Oscilloscope()
scope_channel = 1
if not scope.is_attached():
    print("No scope detected! Check connection!")
    sys.exit(1)
print("Setting up scope!")
# TODO: Are all these extra calls for setup needed?
scope.set_voltage_division(100, 200)
scope.set_voltage_division(1, 6)
scope.set_sampling_rate(500)
samplerate = 1000 * 1000
scope.set_sampling_rate(24)
scope.setup_dso_cal_level()
cal_level = scope.get_calibration_data()
scope.set_dso_calibration(cal_level)

data = []
total = 0

print("Reading data from scope!")
for x in range(0, 10):
    print(x)
    data.append(
        scope.read_data_from_scope(1047550, raw_data=True)[scope_channel - 1])
    total += len(data[x])
コード例 #5
0
import time

import pylab

from PyHT6022.HTSDKScope import Oscilloscope


if __name__ == "__main__":
    scope0 = Oscilloscope(scopeid=0)
    if not scope0.is_attached():
        print "WARNING: Scope not found!"
        exit()
    scope0.set_voltage_division(1, 5)
    print scope0.set_sampling_rate(26)
    scope0.setup_dso_cal_level()
    pylab.ion()
    length = 1000
    for i in xrange(0, 10):
        data = scope0.read_data_from_scope(data_points=3000)
        tIndex = data[3].value
        pylab.plot(data[2][:length], data[0][tIndex:tIndex + length])  # , 'r-')
        pylab.draw()
        time.sleep(1)