Test and Measurement Forum

3405D MSO -- python, streaming mode

Having problems ? let us know the details here

3405D MSO -- python, streaming mode

Postby hvpg » Tue Feb 27, 2018 10:30 am

Hi Picoscope lovers,

I want to use a picoscope (3405D MSO) for capturing 4-ch data in a custom data handling environments.
Python seems a good candidate for our purpose.

I have manged to get the data in a "block mode" in which I used the ps.runBlock() function (python api) that collects big chunk of data once. And we can fetch the data using function (eg, getDataV etc..).

Now, I am trying to get the data continuouly; a "streaming mode" is what I have found out.
But, there is no "runStreaming" function in the python in "picoscope.ps3000a" class.

Can somebody advise me how to get the streaming data with python enviroment ?
Will there be a SDK that include runStreaming for python?

Is a rapid block mode useable in python?
If yes, how do I use it properly?

Any comments will be appreciated.
Thanks in advance.
hvpg
User
User
 
Posts: 2
Joined: Tue Feb 27, 2018 10:07 am

Re: 3405D MSO -- python, streaming mode

Postby Hitesh » Wed Feb 28, 2018 10:36 am

Hi hvpg,

There is a streaming example available on GitHub, although we are in the process of investigating a potential issue with the use of the StreamingTape class used in there (try passing a filename as an argument).

A rapid block collection should also be possible using Python to call the API functions from the dll via the bindings that we provide.

It might be helpful to provide information about your application and the requirements for data collection i.e. number of channels, sampling interval, length of capture and how many waveforms.

Regards,
Hitesh

Technical Support Engineer
Hitesh
Site Admin
Site Admin
 
Posts: 2790
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: 3405D MSO -- python, streaming mode

Postby hvpg » Fri Mar 02, 2018 8:46 am

Thank you for the prompt reply.

o Streaming example on Github
- I had tried and found errors regarding DLL, error messages shown below
- I have installed 64bit SDK from the pico web (> pip2 list gives, version of picoSDK 1.0)
- Are the errors occurred due to the DLL 32/64bit issues? How can I resolve the issues..?

o On the applications
We have a on-chip radar transceiver that converts RF radar impulses into at a pretty low time-scale. (not a FMCW radar!)
The result signals from the radar are periodic and the period is on the order of 10 msec ; we can understand 10 meter range is converted 10 msec on the scope. If target is at 6m from the radar, we can see target response on the scope at 6msec from the start point.
So, we want to capture the radar signals (~tens to hundred Hz) in real time using a scope (sampling interval around 1 to tens of usec).
Hopefully, we can direct the signals into the python environment, so that we can analyze on it.

o another question (please see the attached file)
I have captured signals from a function gen. ( on python: picoscope package library and runBlock function is used not picoSDK library mentioned above)
The figure shown attached file is captured first and last frame (1000th frame) :10msec of ramp signal having amplitude of 0~2.5V captured using a runBlock(..) function --- triggered at 0.2 V, sampled 10 usec.

How can I set the ADC resolution correctly?
-Seems there's no implemented setResolution function on the library.
-on the picoscope tool (\PicoScope6\PicoScope.exe), the resolution is changeable.

And, can you elaborate the binding when using the rapid block collection?
Which function should I use for the rapid block collection?

Thank you very much.
HVPG



streaming example error message.
#########################################################################################
RESTART: C:\Users\hvpg\picosdk_python_examples_27\examples\stream_capture.py

Traceback (most recent call last):
File "C:\Users\hvpg\Desktop\picosdk_python_examples_27\examples\stream_capture.py", line 19, in <module>
from example_utils import *
File "C:\Users\hvpg\Desktop\picosdk_python_examples_27\examples\example_utils.py", line 17, in <module>
import scipy.signal as signal
File "C:\Python27\lib\site-packages\scipy\__init__.py", line 118, in <module>
from scipy._lib._ccallback import LowLevelCallable
File "C:\Python27\lib\site-packages\scipy\_lib\_ccallback.py", line 1, in <module>
from . import _ccallback_c
ImportError: DLL load failed: %1 is not a valid Win32 application.
#########################################################################################
Attachments
figure_1.png
hvpg
User
User
 
Posts: 2
Joined: Tue Feb 27, 2018 10:07 am

Re: 3405D MSO -- python, streaming mode

Postby Hitesh » Thu Mar 08, 2018 9:47 am

Hi hvpg,

Apologies for the delay in responding to you.

If you are using a 32-bit Python environment, please install the 32-bit PicoSDK version. You may need to move the location of the PicoSDK's lib directory ahead of the 64-bit PicoSDK and PicoScope 6 on your Windows PATH environment variable.

The resolution of the PicoScope 3000 Series is fixed at 8-bits. The Resolution Enhancement using a moving average filter to add up to 4 bits to the effective resolution.

For the rapid block capture, you will need to use the bindings from the ps3000a.py file that correspond to the sequence of function calls described in section 3.7.2.1 rapid block mode of the Programmer's Guide.

In particular, you need to ensure that you call the following functions from the ps3000a.py file before starting the data collection:

  • MemorySegments()
  • SetNoOfCaptures()

You will also need to setup data buffers (arrays) for each channel/segment combination for which you wish to collect data using the SetDataBuffer() function. It is better to do this before starting data collection.

Post data collection, call the GetValuesBulk() function once to retrieve all the data from the device into the data buffers.

I hope this helps,
Hitesh

Technical Support Engineer
Hitesh
Site Admin
Site Admin
 
Posts: 2790
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire


Return to Getting Started

Who is online

Users browsing this forum: No registered users and 0 guests