Error calling ps3000 functions in MATLAB

Post your MATLAB discussions here
Post Reply
Hud
Newbie
Posts: 0
Joined: Mon Dec 08, 2014 8:50 am

Error calling ps3000 functions in MATLAB

Post by Hud »

Hi,
I've got a problem using a PicoScope 3423 with Matlab. I use ps3000.dll with ps3000.h of the current SDK. My objective is to use the compatible streaming mode. So i followed the instructions:

ps3000_open_unit() -> Device is opened ( I can hear it and I can't use it with PicoScope Software anymore )
But already here starts the problem: The function returns a voidPtr as device handle. So I cant prove if a oscilloscope is found. But I can use this voidPtr as handle for my other functions. ( So I can close it for example)

I can use all functions of the instructions, I just can't read the Returns because I just get voidPtrs. But I don't get data while using ps3000_get_values and as long as I dont know if my Channel is set correctly or if streaming started running I don't know where my configuration issue could be. Is there a possibility to convert those voidPtr to a number or sth like this? (I tried "get( ... ,'value')" already) Please help me to solve this problem.

Code: Select all

if not(libisloaded('ps3000'))
    loadlibrary('ps3000','ps3000.h')
end

unitHandleTemp = 0

unitHandleTemp = calllib('ps3000', 'ps3000_open_unit')

Status = calllib('ps3000','ps3000_close_unit', unitHandleTemp)
(After running this code, my Status and unitHandleTemp looks like that: Status = libpointer)

Regards Michael

Hitesh

Re: Error calling ps3000 functions in MATLAB

Post by Hitesh »

Hi Michael,

It's possible the data types have not been processed correctly when loading the library.

Can you post a screenshot of what is displayed if you call

Code: Select all

libfunctionsview('ps3000');
after calling the loadlibrary function.

Thanks,

Hud
Newbie
Posts: 0
Joined: Mon Dec 08, 2014 8:50 am

Re: Error calling ps3000 functions in MATLAB

Post by Hud »

Hi Hitesh,

screenshot in attachment.

Regards
Michael
Attachments
libfunctionsview.png

Hitesh

Re: Error calling ps3000 functions in MATLAB

Post by Hitesh »

Hi Michael,

You've probably got the stdint.h header file missing from your PC or not on the MATLAB path so it cannot resolve the data types in the header file.

I've generated a prototype file using a 32-bit version of MATLAB which you can use in place of the ps3000.h header file:

Code: Select all

loadlibrary('ps3000.dll', @ps3000MFile);
You can access the enumerations and structures contained in the file as well:

Code: Select all

[methodinfo,structs,enuminfo,ThunkLibName]=ps3000MFile
Hope this helps.
Attachments

[The extension m has been deactivated and can no longer be displayed.]


Hud
Newbie
Posts: 0
Joined: Mon Dec 08, 2014 8:50 am

Re: Error calling ps3000 functions in MATLAB

Post by Hud »

Thank you very much! Now it works fine.

Regards
Michael

Hitesh

Re: Error calling ps3000 functions in MATLAB

Post by Hitesh »

Great! :D

Thanks for letting us know.

Post Reply