PS4000.xls for PICO 4824

Post your VB and VBA discussions here
Post Reply
Paul007
Newbie
Posts: 0
Joined: Tue May 20, 2014 11:14 am

PS4000.xls for PICO 4824

Post by Paul007 »

I understand that 4824 requires a set of libraries that show "a" after "PD4000" (such as ps4000a.dll). I tried to modify the excel example to include the a in libraries and functions but I get "Bad DLL calling convention". Can you post a version of excel macro working with 4824? Thanks in advance.

Karunen
Advanced User
Advanced User
Posts: 194
Joined: Thu Nov 21, 2013 9:22 am

Re: PS4000.xls for PICO 4824

Post by Karunen »

Hi Paul,

I have created an Excel example that captures a block of data using simple trigger.
ps4000a_x64.xls
64 bit Excel example
(368.5 KiB) Downloaded 650 times
Please note that this is a 64 bit example,
if you are using 32 you will have to delete the PtrSafe.

This will be available in the next SDK release.

Also if you want the latest dlls and other examples please download the SDK from

http://www.picotech.com/software.html

Thanks,
Karunen

Technical Specialist
Pico Technology

Paul007
Newbie
Posts: 0
Joined: Tue May 20, 2014 11:14 am

Re: PS4000.xls for PICO 4824

Post by Paul007 »

Hi Karunen:

Thank you for posting ps4000a_x64.xls. I have tried (in 32 bit mode) on my computer and the 4824 initializes ok from what I can see. The problem appears to be that it does not return any data: the IsReady(handle) keeps returning 0 so the program remains in the while IsReady(handle) loop. If I break the loop, values_a array does not have data in it.

Your help would be greatly appreciated.

Paul

Karunen
Advanced User
Advanced User
Posts: 194
Joined: Thu Nov 21, 2013 9:22 am

Re: PS4000.xls for PICO 4824

Post by Karunen »

Hi Paul,

Do you have a signal going into channel A?

If you don't want to put a input on channel A please change

Call ps4000aSetSimpleTrigger(handle, 1, 0, threshold, 0, 0, 0)

to

Call ps4000aSetSimpleTrigger(handle, 0, 0, threshold, 0, 0, 0)

This will disable the trigger and make the scope to capture data immediately.

Thanks,
Karunen

Technical Specialist
Pico Technology

Paul007
Newbie
Posts: 0
Joined: Tue May 20, 2014 11:14 am

Re: PS4000.xls for PICO 4824

Post by Paul007 »

Hi Karunen:

Found the problem: USB cable!!!

The scope came with blue USB cable with PICO sticker saying that it is certified for high speed (and two computer end plugs for more power). However, the computer controller (or is it the scope?) does not perceive it as USB 3.0 and reverts to USB 2.0. I used USB 3.0 cable marked with Super Speed (SS) logo and all is well.

The way I found out was that the RunBlock was returning an 11E error. First I thought that the USB 3.0 is disabled in the BIOS but it was just the cable.

You may want to share this with others since even the PicoScope 6 was running under USB 2.0 as far as I can tell.

Thanks for your help.

Karunen
Advanced User
Advanced User
Posts: 194
Joined: Thu Nov 21, 2013 9:22 am

Re: PS4000.xls for PICO 4824

Post by Karunen »

Hi Paul,

Sorry I should have added in the case where it does not use USB3.0

Please add

Code: Select all

Declare Function ps4000aChangePowerSource Lib "ps4000a.dll" (ByVal handle As Integer, ByVal status As Integer) As Integer
And

Code: Select all

  If status = 286 Then
    status = ps4000aChangePowerSource(handle, status)
    End If
After

Code: Select all

    If handle = 0 Then
        MsgBox "Unit not opened", vbOKOnly, "Error Message"
        Exit Sub
    End If
I have updated it in the software development kit.

The two headed cable is intend for those who do not have a USB3.0 port to make sure the device has enough power.

Thanks,
Karunen

Technical Specialist
Pico Technology

Paul007
Newbie
Posts: 0
Joined: Tue May 20, 2014 11:14 am

Re: PS4000.xls for PICO 4824

Post by Paul007 »

Thanks for all your help, I will add it to my programs to keep them USB version independent.

Paul

Post Reply