Streaming with Python

Post general discussions on using our drivers to write your own software here
Post Reply
Reynaulu
User
User
Posts: 4
Joined: Tue Nov 20, 2018 12:37 pm

Streaming with Python

Post by Reynaulu » Tue Dec 04, 2018 3:37 pm

Hello all,

I am not familiar with Python and programming with Picoscope. I would like to write a python program in order to record long sets of data (~1hour). I have a Picoscope2206BMSO for starting but I will soon move to a Picoscope 4262 if everything goes well.

Therefore I would like to use a streaming function, and somehow save all the data (time and volt) in a convenient format if possible (.txt or .csv ?). Does that sound possible ?


I started to download PicoSDK and the wrapper from the official picotech github (https://github.com/picotech/picosdk-python-wrappers) but there is no streaming example.
I found the deprecated github https://github.com/picotech/picosdk-python-examples and tried the stream_capture.py but it doesn't work (ModuleNotFoundError: No module named 'exceptions').
I found another Github from a member of this community, Mr Bentham https://github.com/jbentham/picostream where there was a streaming function. I tried it a couple of time and it works but I don't know how to save the data recorded from that software.

Did anyone tried to do streaming and record the data in a format that can be used later ?

Bests !

zipcode
Newbie
Posts: 0
Joined: Wed Dec 05, 2018 8:54 am

Re: Streaming with Python

Post by zipcode » Wed Dec 05, 2018 9:07 am

I am also having problems with streaming in Python. I'm stuck with the callback function.
First I defined the callback function as:

Code: Select all

@CFUNCTYPE(None, c_int16,c_int32,c_uint32,c_int16,c_uint32,c_int16,c_int16,c_int32) 
def callBackStreaming(handle,noOfSamples,startIndex,overflow,triggerAt,triggered,autoStop,pParameter):
	pass
Than I make the call from the GetStreamingLatestValues as:

Code: Select all

m = ps.ps4000aGetStreamingLatestValues(self.handle, callBackStreaming, byref(pCallBack))
I get the following error:

m = ps.ps4000aGetStreamingLatestValues(self.handle, callback, c_void_p())
ctypes.ArgumentError: argument 2: <class 'TypeError'>: wrong type

Does someone have any idea what I am doing wrong?

zipcode
Newbie
Posts: 0
Joined: Wed Dec 05, 2018 8:54 am

Re: Streaming with Python

Post by zipcode » Wed Dec 05, 2018 9:12 am

Where do you problems with https://github.com/jbentham/picostream ?

vincenthuh
Newbie
Posts: 0
Joined: Fri Feb 08, 2019 11:07 am

Re: Streaming with Python

Post by vincenthuh » Fri Feb 08, 2019 3:08 pm

hello I have the same request with you.
I read the same github project too.
I need to save the data from pico-6 software to .csv file. The data is not big, maybe 10M.
I want to find a save function when encounter with a trigger .
I am not sure that if the block function or the streaming function would have a conflict with the software.

zipcode
Newbie
Posts: 0
Joined: Wed Dec 05, 2018 8:54 am

Re: Streaming with Python

Post by zipcode » Wed Feb 13, 2019 1:51 am

Streaming mode with python looks like is not available for now.

Post Reply