PS2000 Fast Streaming

Post your VB and VBA discussions here
Post Reply
F6AXK
Newbie
Posts: 0
Joined: Thu Nov 05, 2015 5:43 pm

PS2000 Fast Streaming

Post by F6AXK » Tue Nov 17, 2015 1:01 pm

I am using Excel VBA (Excel 2007 32 bits over Windows 7 64 bits)
Compatible Streaming is operating with my PicoScope 2205A (though ps2000.en.pdf indicates it's not applicable) but I don't succeed with Fast Streaming (call to ps2000_run_streaming_ns always returns 0)
I will try to decrypt the description in ps2000Wrap.c

Hitesh
Site Admin
Site Admin
Posts: 2829
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: PS2000 Fast Streaming

Post by Hitesh » Wed Nov 18, 2015 2:17 pm

Hi F6AXK,

What parameters are you passing in the call to ps2000_run_streaming_ns?

Regards,
Hitesh

Technical Support Engineer

F6AXK
Newbie
Posts: 0
Joined: Thu Nov 05, 2015 5:43 pm

Re: PS2000 Fast Streaming

Post by F6AXK » Thu Nov 19, 2015 1:53 pm

Hi Hitesh,

After opening the device, setting channels (A enabled) an trigger(inactive), I use :
nn=ps2000_run_streaming_ns(handle, sample_interval, time_units, max_samples, 0, 1, 40000)
with handle =1 (obtained from ps2000_open_unit()) ; sample_interval=100 ; time_units=3 ; max_samples=10000), but I have tried many other values of the parameters and I get always nn=0
I have also tried to include a Call setEnabledChannels and a Call SetBuffer (from ps2000Wrap.dll) before the call to ps2000_run_streaming_ns, but it changes nothing.

Regards

Hitesh
Site Admin
Site Admin
Posts: 2829
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: PS2000 Fast Streaming

Post by Hitesh » Fri Nov 20, 2015 12:32 pm

Hi F6AXK,

How have you defined the ps2000_run_streaming_ns function?

Regards,
Hitesh

Technical Support Engineer

F6AXK
Newbie
Posts: 0
Joined: Thu Nov 05, 2015 5:43 pm

Re: PS2000 Fast Streaming

Post by F6AXK » Fri Nov 20, 2015 2:55 pm

Hi Hitesh,
Definition is :

Code: Select all

Declare Function ps2000_run_streaming_ns Lib "ps2000.dll" (ByVal handle As Integer, ByVal sample_interval As Long, ByVal time_units As Integer, ByVal max_samples As Long, ByVal auto_stop As Integer, ByVal noOfSamplesPerAggregate As Long, ByVal overview_buffer_size As Long) As Integer
Regards

Hitesh
Site Admin
Site Admin
Posts: 2829
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: PS2000 Fast Streaming

Post by Hitesh » Mon Nov 23, 2015 9:32 am

Hi F6AXK,

That looks correct based on previous tests that I have carried out. Could you please post the code that you are calling prior to the call to ps2000_run_streaming_ns()?

Regards,
Hitesh

Technical Support Engineer

F6AXK
Newbie
Posts: 0
Joined: Thu Nov 05, 2015 5:43 pm

Re: PS2000 Fast Streaming

Post by F6AXK » Mon Nov 23, 2015 1:23 pm

Hi Hitesh,

Here is the Excel file I am using (calls to Wrapper functions are here in REM , but nothing change if they are executed). I will go further on in development if I can pass succesfully the call to ps2000_run_streaming_ns()
PS2205A_FastStreaming.xls
Fast Streaming tentative
(66 KiB) Downloaded 221 times
Regards

Hitesh
Site Admin
Site Admin
Posts: 2829
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: PS2000 Fast Streaming

Post by Hitesh » Tue Nov 24, 2015 4:52 pm

Hi F6AXK,

Thanks for the file.

I will need to run some more tests to identify what the cause of the issue is.

I do have an example file that is a work in progress that I can make available if you wish to refer to it - please let me know and I can post it here once it has been checked over.

Regards,
Hitesh

Technical Support Engineer

F6AXK
Newbie
Posts: 0
Joined: Thu Nov 05, 2015 5:43 pm

Re: PS2000 Fast Streaming

Post by F6AXK » Wed Nov 25, 2015 9:49 pm

Hi Hitesh,

Yes I am very interested to look at your example file when it will be checked. Waiting for it

Regards

Hitesh
Site Admin
Site Admin
Posts: 2829
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: PS2000 Fast Streaming

Post by Hitesh » Thu Nov 26, 2015 1:25 pm

Hi F6AXK,

Please find an example below - it should be available via a future SDK release. It has been saved as an xlsm file.
ps2000FastStreaming.xlsm
PS2000 Fast Streaming Excel VBA Example
(34.55 KiB) Downloaded 256 times
The issue with your file was down to the Unite_Temps parameter being defined as an Integer before being passed to the ps2000_run_streaming_ns() call - it needs to be a Long data type.

Regards,
Hitesh

Technical Support Engineer

F6AXK
Newbie
Posts: 0
Joined: Thu Nov 05, 2015 5:43 pm

Re: PS2000 Fast Streaming

Post by F6AXK » Fri Dec 04, 2015 2:20 pm

Hi Hitesh,

Many thanks for your example file and comment.
Your file is running OK with its parameters, but I had some problems (running without stopping) when changing timeUnits value.
Something is not clear for me about that timeUnits parameter (Unite_Temps in my tentative file, that needs to be declared as long according your response). In your Global variables declaration you have "Dim timeUnits As Long", but in ps2000_run_streaming_ns declaration it appears "ByVal timeUnits As Integer". That looks contradictory

Regards

Hitesh
Site Admin
Site Admin
Posts: 2829
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: PS2000 Fast Streaming

Post by Hitesh » Fri Dec 04, 2015 3:55 pm

Hi F6AXK,

Oops :oops:

It should be ByVal timeUnits As Long

A Long data type is used as an enumeration can be a 32-bit integer.

Regards,
Hitesh

Technical Support Engineer

Post Reply