ps4000 Matlab

Post general discussions on using our drivers to write your own software here. Language specific discussion should be posted in the other forums.

ps4000 Matlab

Postby O. Chumak » Fri Dec 04, 2009 3:51 pm

Dear sdk developers,
I tried to use ps4000.dll for incorporating of PicoScope 4424 to the Matlab environment and was successful with the majority of the functions. However there some problems. Most important functions as for example ps4000RunBlock uses callback which is not supported by Matlab. Can such functions be rewritten for Matlab users so that callback routine would be excluded? For example I will ask manually if a record is done and than copy data via variable or memory pointer instead of using callback routine ps4000DataReady.

Best regards,
Oleksiy Chumak.
O. Chumak
 

Re: ps4000 Matlab

Postby Robin » Fri Dec 04, 2009 4:34 pm

Hi

In the SDK there is a wrapper DLL that avoids the need to pass function pointers to run block. The source code (ps4000wrap.c) is also included in the SDK so you can see how to use it.

Robin
Robin
Site Admin
Site Admin
 
Posts: 563
Joined: Fri Sep 19, 2008 11:17 am

Re: ps4000 Matlab

Postby Oleksiy » Fri Dec 04, 2009 5:27 pm

Thank you for the prompt reply.
We tried to use it but in such form it became more complicated. I need header file to load this wrap.dll to Matlab. Using two libraries rises some other questions. We try also to create our wrap file with partial success. Perhaps we can do it finally if you provide us header file or when we prepare our wrapper.
However it would be much easier if the wrapping functions would be simply in the primary dll and in primary header file. If it is not too complicate consider this, it would help as a lot.
Best regards,
Oleksiy.
Oleksiy
Newbie
 
Posts: 0
Joined: Fri Nov 06, 2009 10:54 am

Re: ps4000 Matlab

Postby Christopher » Thu Jul 15, 2010 3:29 pm

I have a picoscope 4xxx and would like to get the dll libraries working in Matlab. I have never played with dlls in Matlab and it seems a little less straightforward than I had hoped, I have been modifying the ps2000 example, but haven't yet been able to get any data from the picoscope. I was wondering if anybody has some simple Matlab code they can provide which just uses the ps4000Api.h/ps4000.dll to get data from the picoscope.
Thanks!
Christopher
Christopher
 

Re: ps4000 Matlab

Postby Oleksiy » Fri Jul 23, 2010 2:36 pm

Here a files set prepared for three PicoScope 4424 units, perhaps it will help you. This program did not work properly but the problem was in communication with three units, with only one unit it could work. You should change the program for only one units mainly by deleting of unnecessary functions. It used ps4000sdk_r6_2_14_0 but may be will work with updated one. Start with Main file.
I am out of office and internet next month and can answer any questions in the end of august.
Good luck!

Oleksiy.
Attachments
PicoMatlab.zip
(5.8 KiB) Downloaded 48 times
Oleksiy
Newbie
 
Posts: 0
Joined: Fri Nov 06, 2009 10:54 am

Re: ps4000 Matlab

Postby Hamsteh » Wed Aug 11, 2010 3:01 am

I too am finding the same issue.

I am finding it difficult to emulate the callback function in ps6000_RunBlock using Matlab.

ps3000_run_block used to work perfectly with Matlab, a similar function would be most appreciated, or if anybody has a workaround it would save me a lot of headaches.

Regards,
Alex
Hamsteh
Newbie
 
Posts: 0
Joined: Mon Aug 09, 2010 6:36 am

Re: ps4000 Matlab

Postby Robin » Wed Aug 11, 2010 8:39 am

Robin
Site Admin
Site Admin
 
Posts: 563
Joined: Fri Sep 19, 2008 11:17 am

Re: ps4000 Matlab

Postby Robin » Mon Oct 04, 2010 3:43 pm

Submitted by Oleksiy:

I have added library and header file from ps4000sdk to the previous set, thus it is functioning set now.

Just to summarize: there is set of files to run three units Picoscope
4424 in Matlab environment. It is functioning, however troubles with memory management lead to occasional errors mainly in Enumerate units function. You can significantly simplify program to operate only one unit and the errors must disappear. Or just use it like an inspiration.
Once you make functioning program publish it here for others users and the topic will be solved. Good luck.

Oleksiy Chumak.
Attachments
PicoMatlab.zip
(400.47 KiB) Downloaded 51 times
Robin
Site Admin
Site Admin
 
Posts: 563
Joined: Fri Sep 19, 2008 11:17 am


Return to General Software Discussions

Who is online

Users browsing this forum: No registered users and 0 guests