Streaming
Streaming in a PicoScope is a great tool for monitoring a waveform for a long period of time
without the delay between block captures. Though this method of capture is fairly limited in
sample rate and usability in comparison to a block capture
and especially rapid block capture
.
Using Streaming in pyPicoSDK
Streaming is implemented in this package as a class to take advantage of the benefits offered by an object-oriented approach. For a quick start-up use the example code and alter it to your application.
Methods & Functions
Below are the included public methods for streaming:
Methods:
Name | Description |
---|---|
add_channel |
!NOT YET IMPLEMETED! |
config_streaming |
Configures the streaming settings for data acquisition. This method sets up the channel, |
main_streaming_loop |
Main loop for handling streaming data acquisition. |
run_streaming |
Initiates the data streaming process. |
run_streaming_for |
Runs the streaming acquisition loop for a fixed number of iterations. |
run_streaming_for_samples |
Runs streaming acquisition until a specified number of samples are collected. |
run_streaming_while |
Starts and continuously runs the streaming acquisition loop until |
stop |
Signals the streaming loop to stop. |
add_channel(channel, ratio_mode=RATIO_MODE.RAW, data_type=DATA_TYPE.INT16_T)
!NOT YET IMPLEMETED! Adds a channel configuration for data acquisition.
This method appends a new channel configuration to the internal list, specifying the channel, ratio mode, and data type to be used for streaming.
Parameters: |
|
---|
Returns: |
|
---|
config_streaming(channel, samples, interval, time_units, max_buffer_size, pre_trig_samples=0, post_trig_samples=250, ratio=0, ratio_mode=RATIO_MODE.RAW, data_type=DATA_TYPE.INT16_T)
Configures the streaming settings for data acquisition. This method sets up the channel, sample counts, timing intervals, and buffer management for streaming data from the device.
Parameters: |
|
---|
Returns: |
|
---|
main_streaming_loop()
Main loop for handling streaming data acquisition.
This method retrieves the latest streaming data from the device, appends new samples to the internal buffer array, and manages buffer rollover when the hardware buffer becomes full.
The method ensures that the internal buffer (self.buffer_array
) always
contains the most recent samples up to max_buffer_size
. It also handles
alternating between buffer segments when a buffer overflow condition is detected.
run_streaming()
Initiates the data streaming process.
This method prepares the device for streaming by clearing existing data buffers, setting up a new data buffer for the selected channel, and starting the streaming process with the configured parameters such as sample interval, trigger settings, and downsampling options.
The method resets internal buffer indices and flags to prepare for incoming data.
run_streaming_for(n_times)
Runs the streaming acquisition loop for a fixed number of iterations.
Parameters: |
|
---|
run_streaming_for_samples(no_of_samples)
Runs streaming acquisition until a specified number of samples are collected.
The loop will terminate early if StreamingScope.stop()
is called.
Parameters: |
|
---|
Returns: |
|
---|
run_streaming_while()
Starts and continuously runs the streaming acquisition loop until StreamingScope.stop() is called.
stop()
Signals the streaming loop to stop.