Test and Measurement Forum

Error using MatLab GUI on Notebook

Post your MATLAB discussions here

Error using MatLab GUI on Notebook

Postby gammy89 » Wed Sep 21, 2016 12:35 pm

Hello!

I created a MatLab GUI on my notebook (Acer Aspire E1-572G, 64bit), which i use to analyze data (FFT, etc.) stored on my harddrive (previously taken measurements) as well as collecting new data from a Picoscope 4824 USB Oscilloscope. When i run the GUI in MatLab everything works fine on my notebook. Now i created a standalone "exe"-file using the Application Compiler. It also works fine when i run this on my notebook. As soon as i switch the other notebook (Dell Latitude, 32bit): Loading data from the harddrive or USB drive and analyzing it works fine, but when i try to connect to the Picoscope 4824, an error occurs:

Code: Select all
Error using icdevice/connect <line 112>
An error occured while executing the drive connect code.
Unit not supported.


I also typed in the serial number of the device:
Code: Select all
ps4000aDeviceObj = icdevice('picotech_ps4000a_generic.mdd', 'CZ773/195');


I guess that it may be something wrong with the .dll, thunk-files or whatever. Does anyone have any idea of what is wrong?

Best wishes,
gammy
gammy89
Newbie
 
Posts: 0
Joined: Wed Sep 21, 2016 12:24 pm

Re: Error using MatLab GUI on Notebook

Postby Hitesh » Thu Sep 22, 2016 10:39 am

Hi Gammy,

When you built the application using MATLAB Compiler, did you include the ps4000aMFile.m and ps4000aWrapMFile.m from the win32 folder in the Instrument Driver package?

Are the 32-bit ps4000a, picoipp and ps4000aWrap dlls packaged or is their location somewhere on the PC's PATH environment variable.

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2058
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Error using MatLab GUI on Notebook

Postby gammy89 » Sun Sep 25, 2016 3:35 pm

Hello and thanks for the answer.

I was wrong...both notebooks have windows 64-bit version (because adding the 32-bit files, as you mentioned, didn't work - then i found out, it is 32-bit). As far as i know, the two files you mentioned are packaged - at least they are in the mathlab path and i add them during the compilation process. Is it possible that my program searches for them elswhere during execution (and so it works on my laptop, because "it knows, where they are")?
I attached a picture of all files that i package. pendel_app is the main function.

Maybe i should mention that the other notebook was used for measurements with picoscope 6 for the last few years and the software hasn't been updated for at least 3 years. Does that matter?

Kind regards
Georg
Attachments
files2.JPG
files1.JPG
gammy89
Newbie
 
Posts: 0
Joined: Wed Sep 21, 2016 12:24 pm

Re: Error using MatLab GUI on Notebook

Postby Hitesh » Mon Sep 26, 2016 10:27 am

Hi Georg,

The PicoScope 4824 was launched in early 2014 so if the software was installed before then, the device might not be recognised.

If it is a 32-bit version of MATLAB on the PC, please ensure that you install the PicoSDK 32-bit version from https://www.picotech.com/downloads.

Please refer to this post for installation instructions. You will only need to install files for the ps4000a driver.

The installer will add the location of the dll files to your Windows PATH environment variable.

Also, you do not need to package the Pipe_inOut and Pipe_inOutFiFo files as these were generated by a bug in the driver (a fix will appear in the next release of the SDK).

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2058
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Error using MatLab GUI on Notebook

Postby gammy89 » Mon Sep 26, 2016 11:22 am

Dear Hitesh,
thanks for your reply! But sorry, i'm still a bit confused:

The PicoScope 4824 was launched in early 2014 so if the software was installed before then, the device might not be recognised.

This is only interesting for running the 4824 with Picoscope 6, or does it affect my (matlab-)problem? What will happen if i install the newest version?

If it is a 32-bit version of MATLAB on the PC, please ensure that you install the PicoSDK 32-bit version from https://www.picotech.com/downloads.

The installer will add the location of the dll files to your Windows PATH environment variable.

It is a 64-bit version, too. It was my mistake in my opening post.
So, you mean, that i have to install the PicoSDK 64-bit version on the external laptop (on which i have my connection-problem) following the steps in your link? Is it then necessary to add/packade all the .dll files to my standalone-exe? Shouldn't it find these files already in the correct path, because i have added them to the package?

Also, you do not need to package the Pipe_inOut and Pipe_inOutFiFo files as these were generated by a bug in the driver (a fix will appear in the next release of the SDK).

Ok, i will remove them.

Kind regards,
Georg
gammy89
Newbie
 
Posts: 0
Joined: Wed Sep 21, 2016 12:24 pm

Re: Error using MatLab GUI on Notebook

Postby Hitesh » Tue Sep 27, 2016 10:10 am

Hi Georg,

If you only had the old version of PicoScope (6.7 or earlier) installed on the 32-bit and the SDK was not installed, then the driver would not recognise the oscilloscope.

The latest version of the PicoScope software will be fine.

You can choose to install the SDK on the PC on which the executable will run or package the dlls as part of the executable. The first option is better as driver changes/fixes could be made in the future.

If you are using a 32-bit version of MATLAB then you will need the 32-bit SDK and if it is a 64-bit version of MATLAB then you will need the 64-bit SDK.

You also do not need the ps4000a.lib file as part of the package.

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2058
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Error using MatLab GUI on Notebook

Postby gammy89 » Tue Sep 27, 2016 10:35 am

In the meantime i installed the Pico SDK and now it does work. :)

But i'm still curious of what the problem was and if it is possible to run the device on an external pc without installing Pico SDK - regarding your postsat: https://www.picotech.com/support/topic18991.html it is possible, but what are exactly the files that i need? Do i need to package the whole "system" folder (...Picotechnology\SDK\system), as you mentioned in your post from "Thu May 05, 2016 2:18 pm" or just some single files? Regarding the Programmer's Guide Picoscope 4000 Series (A API), 3.1. Driver (page5) it is:
ps4000a.dll
CyUSB3.sys
WinUsb.sys

as well as (what i've already added to my package):
ps4000a.lib
ps4000a_thunk_pcwin64.dll
ps4000aWrap_thunk_pcwin64.dll
picotech_ps4000a_generic.mdd
picoipp.dll
ps4000aWrap.dll
ps4000aWrap.lib

Kind regards
Georg
gammy89
Newbie
 
Posts: 0
Joined: Wed Sep 21, 2016 12:24 pm

Re: Error using MatLab GUI on Notebook

Postby Hitesh » Tue Sep 27, 2016 3:40 pm

Hi Georg,

From the 32-bit OS PC, could you please run PicoScope 6, click Help -> About PicoScope 6 and copy and paste the text from the dialog by reply?

As the SDK was not previously installed on the PC, the application would have looked for the ps4000a.dll in locations specified in the Windows PATH environment variable (assuming that the dll was not in the same folder as the executable) and found the PicoScope 6 installation directory.

When the SDK is installed, the location of the libraries is added to the front of the list of directories that make up the PATH environment variable.

You do not need any of the .lib files so from your list you will need the following:

ps4000a_thunk_pcwin64.dll
ps4000aWrap_thunk_pcwin64.dll
picotech_ps4000a_generic.mdd
picoipp.dll
ps4000aWrap.dll

You will still need the PS4000aConstants.m and if required the PS4000aConfig.m files, as well as the ps4000aMFile.m and ps4000aWrap.m files from the win64 folder in the Instrument Driver package.

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2058
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Error using MatLab GUI on Notebook

Postby gammy89 » Mon Oct 17, 2016 8:09 pm

Dear Hitesh,

in the meantime the Picoscope 6 is no longer on the PC, but my application works - after i followed your instructions and simply installed the PicoSDK.

Thank you very much for your patience and your help.

Kind regards
Georg
gammy89
Newbie
 
Posts: 0
Joined: Wed Sep 21, 2016 12:24 pm

Re: Error using MatLab GUI on Notebook

Postby Hitesh » Tue Oct 18, 2016 8:01 am

Hi Georg,

Thank you for the update - good to hear all is working.

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2058
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire


Return to MATLAB

Who is online

Users browsing this forum: No registered users and 0 guests