|
78 | 78 | clear = enums.PICO_ACTION["PICO_CLEAR_ALL"] |
79 | 79 | add = enums.PICO_ACTION["PICO_ADD"] |
80 | 80 | action = clear | add # PICO_ACTION["PICO_CLEAR_WAVEFORM_CLEAR_ALL"] | PICO_ACTION["PICO_ADD"] |
81 | | -actionB = add |
| 81 | +actionAdd = add |
82 | 82 | status["setDataBuffersA"] = ps.ps6000aSetDataBuffer(chandle, channelA, ctypes.byref(bufferA[0]), nSamples, dataType, |
83 | 83 | waveform, downSampleMode, action) |
84 | 84 | assert_pico_ok(status["setDataBuffersA"]) |
85 | | -status["setDataBuffersB"] = ps.ps6000aSetDataBuffer(chandle, channelB, ctypes.byref(bufferA[0]), nSamples, dataType, |
86 | | - waveform, downSampleMode, actionB) |
| 85 | +status["setDataBuffersB"] = ps.ps6000aSetDataBuffer(chandle, channelB, ctypes.byref(bufferB[0]), nSamples, dataType, |
| 86 | + waveform, downSampleMode, actionAdd) |
87 | 87 | assert_pico_ok(status["setDataBuffersB"]) |
88 | 88 |
|
89 | 89 | # Run streaming |
|
98 | 98 | assert_pico_ok(status["runStreaming"]) |
99 | 99 |
|
100 | 100 | streamData = (structs.PICO_STREAMING_DATA_INFO * 2)() |
101 | | -streamData[0] = structs.PICO_STREAMING_DATA_INFO(channelA, downSampleRatio, dataType, 0, 0, 0, 0) |
102 | | -streamData[1] = structs.PICO_STREAMING_DATA_INFO(channelB, downSampleRatio, dataType, 0, 0, 0, 0) |
| 101 | +streamData[0] = structs.PICO_STREAMING_DATA_INFO(channelA, downSampleMode, dataType, 0, 0, 0, 0) |
| 102 | +streamData[1] = structs.PICO_STREAMING_DATA_INFO(channelB, downSampleMode, dataType, 0, 0, 0, 0) |
103 | 103 |
|
104 | 104 | streamTrigger = structs.PICO_STREAMING_DATA_TRIGGER_INFO(0, 0, 0) |
105 | 105 |
|
|
121 | 121 | count = count + 1 |
122 | 122 | if count <= maxBuffers: |
123 | 123 | status["setDataBufferA"] = ps.ps6000aSetDataBuffer(chandle, channelA, ctypes.byref(bufferA[count - 1]), |
124 | | - nSamples, dataType, waveform, downSampleMode, actionB) |
| 124 | + nSamples, dataType, waveform, downSampleMode, actionAdd) |
125 | 125 | assert_pico_ok(status["setDataBufferA"]) |
126 | 126 | status["setDataBufferB"] = ps.ps6000aSetDataBuffer(chandle, channelB, ctypes.byref(bufferB[count - 1]), |
127 | | - nSamples, dataType, waveform, downSampleMode, actionB) |
| 127 | + nSamples, dataType, waveform, downSampleMode, actionAdd) |
128 | 128 | assert_pico_ok(status["setDataBufferB"]) |
129 | 129 | print(count) |
130 | | - |
| 130 | +ps.ps6000aStop(chandle) |
| 131 | +noOfStreamedSamples=ctypes.c_uint64() |
| 132 | +ps.ps6000aNoOfStreamingValues(chandle,ctypes.byref(noOfStreamedSamples)) |
131 | 133 | print("streaming finished") |
| 134 | +print(noOfStreamedSamples.value) |
| 135 | + |
132 | 136 |
|
133 | 137 | # get max ADC value |
134 | 138 | # handle = chandle |
|
138 | 142 | assert_pico_ok(status["getAdcLimits"]) |
139 | 143 |
|
140 | 144 | # convert ADC counts data to mV |
| 145 | +plt.plot(bufferA[5]) |
| 146 | +plt.plot(bufferB[9]) |
| 147 | +plt.show() |
141 | 148 | # bufferAmV = ((ctypes.c_int16 * nSamples) * 10)() |
142 | 149 | # bufferBmV = ((ctypes.c_int16 * nSamples) * 10)() |
143 | 150 | # for j in range(0, 9): |
|
0 commit comments