VBA activiation and control of PS 4824

Post your VB and VBA discussions here
Post Reply
SteveK
Newbie
Posts: 0
Joined: Mon Jul 01, 2019 2:28 pm

VBA activiation and control of PS 4824

Post by SteveK » Mon Jul 01, 2019 2:47 pm

Hi
I want to be able to use VBA in excel to analyse and present the data collected by a PS 4824. I am using the attached ps4000.xlsm as a template to get going and have downloaded both versions (32, 64 bit) of the SDK. I'm running the scope on a USB 3 laptop.
Using the 64 bit SDK the VBA crashes out at the line shown below
Call SetTriggerProperties(handle, triggerChannelPropertiesArray(0), 1, 10000) ' autoTrig = 10000 ms
error ps4000Wrap.dll not found.
Switching to the 32 bit SDK th eprogram passes this but gets stuck in this loop
' Poll the device to see if it has finished collecting data
While IsReady(handle) = 0
Sleep (5)
Wend
For both cases the scope has NOT activiated (green light, relay click), in both cases only the driver version is collected from the 5 status points listed on the spreadsheet.

Any advice appreciated
Attachments
ps4000.xlsm
(35.24 KiB) Downloaded 3 times

Martyn
Site Admin
Site Admin
Posts: 3609
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: VBA activiation and control of PS 4824

Post by Martyn » Mon Jul 01, 2019 9:20 pm

For the 4824 you need the ps4000a examples.
Martyn
Technical Support Manager

SteveK
Newbie
Posts: 0
Joined: Mon Jul 01, 2019 2:28 pm

Re: VBA activiation and control of PS 4824

Post by SteveK » Fri Jul 05, 2019 11:41 am

Thanks Martyn

I found the attached code which I have modified for 32 bit Excel, this still doesnt seem to open the unit. I've also added the power supply code as recommended in the post PS4000.xls for pico4824 dated May 2014. Also should there be these sample files in the SDK?
Attachments
Copy of ps4000a_x64.xls
(365 KiB) Downloaded 4 times

SteveK
Newbie
Posts: 0
Joined: Mon Jul 01, 2019 2:28 pm

Re: VBA activiation and control of PS 4824

Post by SteveK » Fri Jul 05, 2019 12:18 pm

Hi Martyn

The most recent code I posted did eventually work, just needed to turn th ecomputer off and on :D

Thanks

Post Reply