Error using MatLab GUI on Notebook

Post your MATLAB discussions here
Post Reply
gammy89
Newbie
Posts: 0
Joined: Wed Sep 21, 2016 12:24 pm

Error using MatLab GUI on Notebook

Post by gammy89 »

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

Hitesh

Re: Error using MatLab GUI on Notebook

Post by Hitesh »

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,

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

Re: Error using MatLab GUI on Notebook

Post by gammy89 »

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

Hitesh

Re: Error using MatLab GUI on Notebook

Post by Hitesh »

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,

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

Re: Error using MatLab GUI on Notebook

Post by gammy89 »


Hitesh

Re: Error using MatLab GUI on Notebook

Post by Hitesh »

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,

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

Re: Error using MatLab GUI on Notebook

Post by gammy89 »

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: 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

Hitesh

Re: Error using MatLab GUI on Notebook

Post by Hitesh »

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,

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

Re: Error using MatLab GUI on Notebook

Post by gammy89 »

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

Hitesh

Re: Error using MatLab GUI on Notebook

Post by Hitesh »

Hi Georg,

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

Regards,

Post Reply