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 » Tue Sep 24, 2013 9:39 am

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
Site Admin
Site Admin
Posts: 2829
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: PS5000 Load Library Error

Post by Hitesh » Tue Sep 24, 2013 10:37 am

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.
Hitesh

Technical Support Engineer

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

Re: PS5000 Load Library Error

Post by Gustav » Wed Sep 25, 2013 9:35 pm

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
Site Admin
Site Admin
Posts: 2829
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: PS5000 Load Library Error

Post by Hitesh » Thu Sep 26, 2013 8:10 am

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,
Hitesh

Technical Support Engineer

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

Re: PS5000 Load Library Error

Post by Gustav » Thu Sep 26, 2013 9:32 pm

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
Site Admin
Site Admin
Posts: 2829
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: PS5000 Load Library Error

Post by Hitesh » Fri Sep 27, 2013 8:15 am

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,
Hitesh

Technical Support Engineer

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

Re: PS5000 Load Library Error

Post by Gustav » Mon Sep 30, 2013 9:55 am

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
Site Admin
Site Admin
Posts: 2829
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: PS5000 Load Library Error

Post by Hitesh » Mon Sep 30, 2013 10:20 am

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,
Hitesh

Technical Support Engineer

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

Re: PS5000 Load Library Error

Post by Gustav » Thu Oct 03, 2013 1:08 pm

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
Site Admin
Site Admin
Posts: 2829
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: PS5000 Load Library Error

Post by Hitesh » Thu Oct 03, 2013 2:39 pm

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,
Hitesh

Technical Support Engineer

Post Reply