How can i set up my Picoscope Device in Instrument Control Toolbox?

Hello! For my master’s thesis i need to do measurements with a measurement microphone and i use PicoScope 4824 as a USB-oscilloscope. Unfortunately i’m unable to cope with the installation/the setup in Instrument Control Toolbox. I’m pretty sure that all drivers are on the Pico-CD and somewhere in the internet, but i’m asking for something like a short guide (or similar) that guides me through the process.
I already started, but MatLab doesn’t identify the Pico and i already had a few problems with Windows SDK...
Greetz Georg

 Accepted Answer

Hello Georg,
Below are the steps that we would recommend taking when installing our Instrument Driver packages on Microsoft Windows platforms:
  1. Download the Instrument Driver package for the PicoScope 4824 from MATLAB Central - if you are using MATLAB 2015b, you can install this via the Add-On Manager.
  2. Download and install the PicoScope Support Toolbox (again use the Add-On Manager if you have MATLAB 2015b).
  3. If you are using a 64-bit version of MATLAB, please install the Windows SDK 7.1 referring to the How do I install Microsoft Windows SDK 7.1? article and note the information about uninstalling the Microsoft Visual C++ 2010 Redistributable first.
  4. Download and install the 32-bit or 64-bit Software Development Kit (Stable Release) from the Pico Technology Downloads page - install the drivers and examples for the PS4000A driver.
  5. If you are using a 64-bit version of MATLAB navigate to the C:\Program Files (x86)\Pico Technology\SDK\src\MATLAB\ps4000a\win64 folder on your PC, and copy the ps4000a_thunk_pcwin64.dll and ps4000aWrap_thunk_pcwin64.dll files to the ps4000a\win64 directory of the Instrument Driver package that you installed in Step 1.
  6. Start MATLAB and type mex -setup then follow the instructions in order to setup Microsoft SDK 7.1 as the C compiler.
  7. Add the ps4000a directory to your MATLAB path and then try running the PS4000A_ID_Block_Example.m example script that is located in the examples directory.
There are html help pages for the examples contained in this package.
If you still require further assistance, it would be helpful to know which version of MATLAB you are using and whether it is 32-bit or 64-bit.
Hope this helps!

13 Comments

Thank you for your very helpful answer!
I'm using MatLab2015b, 64-bit-Version! In the meanwhile i was able to run the mex -setup and MatLab says: MEX configured to use 'Microsoft Windows SDK 7.1 (C)' for C language compilation. So, this issue (Windows SDK, Visual C++, etc.) should be fixed, i guess.
I also downloaded the Pico SDK and copied the .dll files into the folders as described in: https://www.picotech.com/support/topic14203.html
Now i wanted to start the example PS4000A_ID_Block_Example.m, as described by you...it doesen't work!
See the attached picture!
Thanks for your help, again. Georg
When i try to run the example mentioned above, i get the following error:
Now, after re-copying the .dll files, etc. i get the following error:
Hi Georg,
Did you download and install the 64-bit Pico SDK?
Which files are in the win64 folder in the screenshot above?
Please could you try the following commands in MATLAB:
loadlibrary('ps4000a.dll', @ps4000aMFile);
libfunctionsview('ps4000a');
unloadlibrary('ps4000a');
loadlibrary('ps4000aWrap.dll', @ps4000aWrapMFile);
libfunctionsview('ps4000aWrap');
unloadlibrary('ps4000aWrap');
If you get an error when attempting to load the wrapper dll, this means that the Microsoft Visual C++ 2010 SP1 Redistributable (x64) has not been correctly installed.
You may need to refer back to the article on installing Windows SDK 7.1 and follow the procedure to uninstall it, install the redistributable, and then re-install the Windows SDK 7.1.
Does the PicoScope 4824 work correctly with the PicoScope 6 software?
Hi Georg,
Looks like my previous response crossed with the last post.
Please try the unloadlibrary calls from the code snippet above and then run the whole code section.
Please ensure that the PicoScope 6 software is not connected to the device when you attempt to run the MATLAB code.
Thanks for your replies!
In the meanwhile - before i recognized your answers - i was able to run the first example (...ID_BLOCK-EXAMPLE). But in a second attempt a few minutes later i got the error "no devices found" again (without changing anything in the settings). So - i little desperated - i deleted and uninstalled all drivers and i will now start to reinstall again.
I just recognized your answer and i think that it was an issue with the Picoscope 6 software. My 4828 works works well in it and maybe i had Picoscope 6 open during i worked in MatLab - I'm not 100% sure, but i think so, because i used it to check whether usb-connection works or not.
@installation process: Which path is it that i have to add to matlab (or let's say that i have to work in)? Is it the path of the Pico SDK or the path of the Instrument Driver package? Why do i have to install both and how do i "combine" them? I don't fully understand how and why to copy the .dll files. Does it matter where i save the different folders (Pico SDK and Instrument Driver package) as long as i find the right folder in matlab?
With kind regards, Georg
I just ran the whole installation process (from your first comment) again, disconnected the Picoscope 6 and started the example...
... and now it works - although i do not really know why (it's a pity)!!! :-)
Hi Georg,
Good to hear that it is working!
To answer your previous question about paths, I would recommend using the Instrument Driver package from File Exchange as these files are up to date.
When the PS4000aConfig file is run it will try to add the path to the library files from the SDK. You just need to copy the thunk dll files into the win64 folder.
Hello and thanks for your reply!
Now i can run all the examples (ID_Block_Example, etc. as well as IC_Generic_Driver_Block, etc.), but when i open the Test&Measurement Tool and i try to connect to my Pico, then it says "unable to connect to the instrument"!
Hi Georg,
Have you run the PS4000aConfig file before trying to connect via the Test & Measurement Tool?
Hi, yes, i ran the Config file and then tried to connect - then it worked. Is it possible that it was because of the examples? Because recently i ran the Block Example and then i tried to connect - and connection failed! Is it possible that the example doesn't disconnect properly?
Hi Georg,
You need to run the PS4000aConfig file first (the examples call this script) before attempting a connection to the Instrument Driver.
The example should disconnect correctly by first calling the disconnect() function and then delete() on the Instrument Driver object (called ps4000aDeviceObj in the examples).
If you still getting errors, please post a screenshot of tmtool.
Hello! Thank you again for your support. Everything works fine now. I decided to write a script in MatLab without using the tmtool as i slowly begin to understand the source code of the examples PS4000A_ID_BLOCK_FFT_EXAMPLE and PS4000A_IC_GENERIC_DRIVER_BLOCK_FFT
I just try to understand the examples and then i will change it step by step in order to get the required results...

Sign in to comment.

More Answers (1)

I have tried the upper solution of how to set up the picoscope with matlab-alas! it doesn't work. According to their new driver update we don't have to perform step 5 any more. we have to copy and paste the entire tool box package to the instrument driver package. Further there is no trace of 'src' folder anymore though I sort it out that, the two .dll file has to be pasted in all the folders(program files/pico technology/ SDK/ ) in order to make it work. If you have installed the microsoft SDK and still you find error in the mex -setup - no SDK installed its ok to move on. It should work. If the procedure is wrong please let me know because in my end it worked.

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!