Hi,
I modified the python program( see http://ctrlpascal.com/picoscope.htm) for streaming mode. But severals problems exist. One is that the autostop sometimes work, somtimes not. Another problem is that the signal collection is not strictly continuous (see the picture, source is a sine function). Attachment is the python code (python 3).
ps4000a+python+streaming mode problem
ps4000a+python+streaming mode problem
- Attachments
-
- ps4000aStreaming.py
- (5.8 KiB) Downloaded 347 times
-
- Advanced User
- Posts: 2856
- Joined: Tue May 31, 2011 3:43 pm
- Location: St. Neots, Cambridgeshire
Re: ps4000a+python+streaming mode problem
Hi hsun7,
Which version of the ps4000a.dll are you using?
In your code, are you copying the data from the driver buffers to a temporary application buffer in the streaming callback?
Have you tried the Python application from our GitHub repository?
Regards,
Which version of the ps4000a.dll are you using?
In your code, are you copying the data from the driver buffers to a temporary application buffer in the streaming callback?
Have you tried the Python application from our GitHub repository?
Regards,
Hitesh
Software Dev. Engineer
Software Dev. Engineer
Re: ps4000a+python+streaming mode problem
Hi Hitesh,Hitesh wrote:Hi hsun7,
Which version of the ps4000a.dll are you using?
In your code, are you copying the data from the driver buffers to a temporary application buffer in the streaming callback?
Have you tried the Python application from our GitHub repository?
Regards,
Thanks for your reply! I'm not sure the version of ps4000a.dll. I just installed a pico SDK. In my code, I copy the data from buffer to a list after each callback in the application level. I downloaded the Python application you suggested and I'm still working on it. It seems a little difficult for me.
Thanks,
Hongbin
-
- Advanced User
- Posts: 2856
- Joined: Tue May 31, 2011 3:43 pm
- Location: St. Neots, Cambridgeshire
Re: ps4000a+python+streaming mode problem
Hi Hongbin,
Please try the ps4000a.dll and picoipp.dll files from the latest PicoScope 6 release. These are 32-bit dlls.
Alternatively, please e-mail support@picotech.com and we can provide you with a set of 64-bit drivers if you are using a 64-bit Python environment.
Regards,
Please try the ps4000a.dll and picoipp.dll files from the latest PicoScope 6 release. These are 32-bit dlls.
Alternatively, please e-mail support@picotech.com and we can provide you with a set of 64-bit drivers if you are using a 64-bit Python environment.
Regards,
Hitesh
Software Dev. Engineer
Software Dev. Engineer
Re: ps4000a+python+streaming mode problem
Hi,
this period I am also trying streaming mode with a PicoScope 4424 and experience troubles. I adopted the code provided by hsun7 for use on a 4424 and tried it with Python 3.5.2
I use ps4000.dll version 1.2.4.41 (dated: 8/6/2015). This is the dll that works correctly, since when using the newer version 1.5.0.6 (8/2/2017), function ps4000OpenUnit() fails when opening the device. (It returns "-1").
Anyway, I don't get the plot: after executing the callback the program jumps to the "finally" section, performs the CloseUnit() functionality and exits with a ValueError, as shown below:
The callback indicates having acquired 9981 samples, but it seems that it cannot return properly.
Any ideas?
Thank you!
this period I am also trying streaming mode with a PicoScope 4424 and experience troubles. I adopted the code provided by hsun7 for use on a 4424 and tried it with Python 3.5.2
I use ps4000.dll version 1.2.4.41 (dated: 8/6/2015). This is the dll that works correctly, since when using the newer version 1.5.0.6 (8/2/2017), function ps4000OpenUnit() fails when opening the device. (It returns "-1").
Anyway, I don't get the plot: after executing the callback the program jumps to the "finally" section, performs the CloseUnit() functionality and exits with a ValueError, as shown below:
Code: Select all
Traceback (most recent call last):
File "F:\Picoscope\ctrlpascal_2\ps4000_Streaming_2.py", line 172, in
data1 = DoStreaming()
File "F:\Picoscope\ctrlpascal_2\ps4000_Streaming_2.py", line 123, in DoStreaming
status = DLL.ps4000GetStreamingLatestValues(handle, call_back, None)
ValueError: Procedure probably called with not enough arguments (20885764 bytes missing)
Any ideas?
Thank you!
-
- Advanced User
- Posts: 2856
- Joined: Tue May 31, 2011 3:43 pm
- Location: St. Neots, Cambridgeshire
Re: ps4000a+python+streaming mode problem
Hi apos,
Have you tried our Python application from the GitHub repository?
Is the picoipp.dll with the ps4000.dll (presumanbly taken from the PicoScope 6 installation directory?) and have you tried the dlls from the PicoScope 6.12.9 release?
Regards,
Have you tried our Python application from the GitHub repository?
Is the picoipp.dll with the ps4000.dll (presumanbly taken from the PicoScope 6 installation directory?) and have you tried the dlls from the PicoScope 6.12.9 release?
Regards,
Hitesh
Software Dev. Engineer
Software Dev. Engineer
Re: ps4000a+python+streaming mode problem
Hi Hitesh,
I tried with the ps4000.dll from the latest picoscope version. This is v1.5.0.8 and still has the same issue: it returns -1 upon executing ps4000OpenUnit()
To ensure that I have control over the dlls used, I explicitly open them on my application:
The only dll that opens the picoscope is version 1.2.4.41. Below are the details of the picoscope device, as returned when I run the C console example application
Thank you
I tried with the ps4000.dll from the latest picoscope version. This is v1.5.0.8 and still has the same issue: it returns -1 upon executing ps4000OpenUnit()
To ensure that I have control over the dlls used, I explicitly open them on my application:
Code: Select all
os.chdir("F:\\Picoscope\\ctrlpascal\\")
DLL = ctypes.WinDLL("ps4000_v1508.dll")
Code: Select all
Opening the device...
Handle: 16384
Device opened successfully, cycle 1
Driver Version: 1.2.4.41
USB Version: 2.0
Hardware Version: 1
Variant Info: 4424
Serial: ZMR94/293
Cal Date: 18Dec09
Kernel: 1.0
-
- Advanced User
- Posts: 2856
- Joined: Tue May 31, 2011 3:43 pm
- Location: St. Neots, Cambridgeshire
Re: ps4000a+python+streaming mode problem
Hi apos,
We have just released a new PicoSDK version - could you please install the 32-bit/64-bit version as required and then try running the example?
It might be worth copying the ps4000 and picoipp dll files into the same folder as the exe file to ensure that they are being picked up.
Are there any other ps4000 and picoipp dlls on the PC apart from in the PicoScope and PicoSDK installation directories?
Does the PicoScope software detect the device without any issues?
Regards,
We have just released a new PicoSDK version - could you please install the 32-bit/64-bit version as required and then try running the example?
It might be worth copying the ps4000 and picoipp dll files into the same folder as the exe file to ensure that they are being picked up.
Are there any other ps4000 and picoipp dlls on the PC apart from in the PicoScope and PicoSDK installation directories?
Does the PicoScope software detect the device without any issues?
Regards,
Hitesh
Software Dev. Engineer
Software Dev. Engineer
Re: ps4000a+python+streaming mode problem
Hi Hitesh,
as I was a little bit behind schedule I resorted to C which worked without any problem. Therefore I will use C and perform some data post-processing in a seperate python application, which may be a better approach for my application after all.
Anyway, as I found some time to experiment, I tried once again with python and the latest SDK (32bit). However the dll files (ps4000, picoipp) included therein are the same to the ones that come with the latest version of the picoscope application that I had already installed. So no luck with these as well.
The code I used is in pastebin, https://pastebin.com/evJHiGXC
It still crashes upon exiting the callback.
Thanks & regards
as I was a little bit behind schedule I resorted to C which worked without any problem. Therefore I will use C and perform some data post-processing in a seperate python application, which may be a better approach for my application after all.
Anyway, as I found some time to experiment, I tried once again with python and the latest SDK (32bit). However the dll files (ps4000, picoipp) included therein are the same to the ones that come with the latest version of the picoscope application that I had already installed. So no luck with these as well.
The code I used is in pastebin, https://pastebin.com/evJHiGXC
It still crashes upon exiting the callback.
Thanks & regards
Re: ps4000a+python+streaming mode problem
It is possible to do 1 megasample/sec streaming in pure Python, see https://github.com/jbentham/picostream
Jeremy Bentham
Jeremy Bentham