Ejemplo n.º 1
0
    def close(self):
        self.status["stop"] = ps.ps3000aStop(self.chandle)
        assert_pico_ok(self.status["stop"])

        # Closes the unit
        # Handle = chandle
        self.status["close"] = ps.ps3000aCloseUnit(self.chandle)
        assert_pico_ok(self.status["close"])
Ejemplo n.º 2
0
print "Plotting data..."

plt.figure(num='PicoScope 3000 Series (A API) MSO Block Capture Example')
plt.title('Plot of Digital Port 0 digital channels vs. time')
plt.plot(time, bufferDPort0[0], label='D7')  # D7 is the last array in the tuple.
plt.plot(time, bufferDPort0[1], label='D6')
plt.plot(time, bufferDPort0[2], label='D5')
plt.plot(time, bufferDPort0[3], label='D4')
plt.plot(time, bufferDPort0[4], label='D3')
plt.plot(time, bufferDPort0[5], label='D2')
plt.plot(time, bufferDPort0[6], label='D1')
plt.plot(time, bufferDPort0[7], label='D0')  # D0 is the last array in the tuple.
plt.xlabel('Time (ns)')
plt.ylabel('Logic Level')
plt.legend(loc="upper right")
plt.show()

print "Close figure to stop the device and close the connection."

# Stops the scope
# handle = chandle
status["stop"] = ps.ps3000aStop(chandle)
assert_pico_ok(status["stop"])

# Closes the unit
# handle = chandle
status["closeUnit"] = ps.ps3000aCloseUnit(chandle)
assert_pico_ok(status["closeUnit"])

# Displays the status returns
print(status)
Ejemplo n.º 3
0
 def disconnect(self):
     status = {}
     status["close"] = ps.ps3000aCloseUnit(self.chandle)
     assert_pico_ok(status["close"])
bufferAMin = (ctypes.c_int16 * maxsamples)()

# Setting the data buffer location for data collection from channel A
# Handle = Chandle
# source = ps3000A_channel_A = 0
# Buffer max = ctypes.byref(bufferAMax)
# Buffer min = ctypes.byref(bufferAMin)
# Buffer length = maxsamples
# Segment index = 0
# Ratio mode = ps3000A_Ratio_Mode_None = 0
status["SetDataBuffers"] = ps.ps3000aSetDataBuffers(chandle, 0, ctypes.byref(bufferAMax), ctypes.byref(bufferAMin), maxsamples, 0, 0)

sampleInterval = ctypes.c_int32(10)
timeUnits = 3 # PS3000A_US

# Starts the streaming capture

status['runStreaming'] = ps.ps3000aRunStreaming(chandle, ctypes.byref(sampleInterval), timeUnits, preTriggerSamples, postTriggerSamples, 1, 1, 0, maxsamples)

# Stops the scope
# Handle = chandle
status["stop"] = ps.ps3000aStop(chandle)

# Displays the staus returns
print(status)

# Closes the unit
# Handle = chandle
ps.ps3000aCloseUnit(chandle)

Ejemplo n.º 5
0
 def close(self):
     """Close the device."""
     assert_pico_ok(ps.ps3000aCloseUnit(self._handle))
     self._handle = None
    cmaxSamples, bufferAMax)

# Creates the time data
time = np.linspace(0, (cmaxSamples.value) * timeIntervalns.value,
                   cmaxSamples.value)

# Plots the data from digital channel onto a graph
plt.plot(time, bufferAMaxBinaryD0[:])
plt.plot(time, bufferAMaxBinaryD1[:])
plt.plot(time, bufferAMaxBinaryD2[:])
plt.plot(time, bufferAMaxBinaryD3[:])
plt.plot(time, bufferAMaxBinaryD4[:])
plt.plot(time, bufferAMaxBinaryD5[:])
plt.plot(time, bufferAMaxBinaryD6[:])
plt.plot(time, bufferAMaxBinaryD7[:])
plt.xlabel('Time (ns)')
plt.ylabel('Binary')
plt.show()

# Stops the scope
# Handle = chandle
status["stop"] = ps.ps3000aStop(chandle)
assert_pico_ok(status["stop"])

# Closes the unit
# Handle = chandle
status["stop"] = ps.ps3000aCloseUnit(chandle)
assert_pico_ok(status["stop"])

# Displays the staus returns
print(status)