PS5000 Load Library Error

Post your MATLAB discussions here
Post Reply
Gustav
Newbie
Posts: 1
Joined: Sat Jan 23, 2010 1:33 pm

PS5000 Load Library Error

Post by Gustav »

Hi

I am having problems with this line:
>> loadlibrary('PS5000.dll','PS5000MFile')

I have downloaded the latest PS5000.dll by Martyn » Thu Jan 31, 2013.

It gives this message:
Error using loadlibrary (line 419)
There was an error loading the library
"C:\Users\Ion\Documents\MATLAB\mqair\PS5000.dll"
C:\Users\Ion\Documents\MATLAB\mqair\PS5000.dll is not a valid Win32
application.

This has been working before. It could be because I have changed from windows 7 to windows 8. Do you have an idea?

Best Regards,

Gustav

Hitesh

Re: PS5000 Load Library Error

Post by Hitesh »

Hi Gustav,

If you are using a 64-bit version of MATLAB on your Windows 8 installation you will need to use the 64-bit PS5000.dll.

You will also have to recreate the prototype PS5000MFile using the ps5000Api.h header file.

I hope this helps.

Gustav
Newbie
Posts: 1
Joined: Sat Jan 23, 2010 1:33 pm

Re: PS5000 Load Library Error

Post by Gustav »

Hi Hitesh,

Thanks for the reply, but you need to be more specific. How do get the 64bit version of PS5000.dll? And how is the prototype recreated?

Best regards,

Gustav

Hitesh

Re: PS5000 Load Library Error

Post by Hitesh »

Hi Gustav,

The 64-bit dll will be in the Software Development Kit available to download from http://www.picotech.com/software.html

To recreate the prototype file enter the following at the command line:

Code: Select all

loadlibrary 'PS5000.dll' 'ps5000Api.h' mfilename 'PS5000MFile'
On subsequent calls to loadlibrary you can revert to

Code: Select all

 loadlibrary('PS5000.dll','PS5000MFile')
Best wishes,

Gustav
Newbie
Posts: 1
Joined: Sat Jan 23, 2010 1:33 pm

Re: PS5000 Load Library Error

Post by Gustav »

HI Hitesh,

Thanks for the help I think, I am almost through, but I still get the same error message same line. I can see that the file size of the dll has changed since last time I downloaded them some years ago.

What is the mfilename good for? In the command prompt it is empty.



Best Regards,

Gustav

Hitesh

Re: PS5000 Load Library Error

Post by Hitesh »

Hi Gustav,

The prototype files extract information from the header allowing you to access enumerations and structures defined in the header as well as the functions:

http://www.mathworks.co.uk/help/matlab/ ... files.html

Is it a 64-bit version of MATLAB you are using?

Regards,

Gustav
Newbie
Posts: 1
Joined: Sat Jan 23, 2010 1:33 pm

Re: PS5000 Load Library Error

Post by Gustav »

Hi Hitesh,

Thanks for your answer. I have yet to read the link, but regarding the question; Yes, it is 64bit, on Win64 .

R2012b (8.0.0.783)
64 bit (win64)

I have one more nagging question: I plan to change from my good old PicoScope 5203, to 5244B. Will that affect the matlab program? If so, maybe it would be smart to buy the new picoscope first, and then get the matlab connection to work?

Hitesh

Re: PS5000 Load Library Error

Post by Hitesh »

Hi Gustav,

The new PicoScope 5000 series uses a new driver so it would involve a change in the driver and the API, notably the ability to set and change the resolution of the scope.

If you have access to the Instrument Control Toolbox, you can download a Beta version of the driver from the Mathworks File Exchange:

http://www.mathworks.com/matlabcentral/ ... ent-driver

An updated SDK should be available soon containing the underlying dlls required.

Regards,

Gustav
Newbie
Posts: 1
Joined: Sat Jan 23, 2010 1:33 pm

Re: PS5000 Load Library Error

Post by Gustav »

Hi Hitesh,

Yes, I have access to the Instrument Control Toolbox, I just wonder, if it will be any easier to connect to the new PS5000. Is it tested on a few PCs?

Hitesh

Re: PS5000 Load Library Error

Post by Hitesh »

Hi Gustav,

Th advantage of using the Instrument Driver is that it initialises various parameters including channels and block/streaming capture parameters and some of the paratmeters for function calls have been modified.

The streaming aspect requires an update to the underlying wrapper dll and some additional functions but should be available soon.

I've tested it on Windows 7 32-bit and Windows 8 64-bit using MATLAB 2012b.

Regards,

Post Reply