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 »

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

Re: PS2000 Fast Streaming

Post by Hitesh »

Hi F6AXK,

What parameters are you passing in the call to ps2000_run_streaming_ns?

Regards,

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

Re: PS2000 Fast Streaming

Post by F6AXK »

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

Re: PS2000 Fast Streaming

Post by Hitesh »

Hi F6AXK,

How have you defined the ps2000_run_streaming_ns function?

Regards,

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

Re: PS2000 Fast Streaming

Post by F6AXK »

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

Re: PS2000 Fast Streaming

Post by Hitesh »

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,

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

Re: PS2000 Fast Streaming

Post by F6AXK »

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 850 times
Regards

Hitesh

Re: PS2000 Fast Streaming

Post by Hitesh »

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,

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

Re: PS2000 Fast Streaming

Post by F6AXK »

Hi Hitesh,

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

Regards

Hitesh

Re: PS2000 Fast Streaming

Post by Hitesh »

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

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

Re: PS2000 Fast Streaming

Post by F6AXK »

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

Re: PS2000 Fast Streaming

Post by Hitesh »

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,

Post Reply