Test and Measurement Forum

get streaming values pre trigger

Post your .Net discussions here

get streaming values pre trigger

Postby laycockm » Thu Feb 16, 2017 8:53 pm

Hi,
I am using VB.Net and PS2000.dll with a 2204A.
Both channels A and B are enabled.
I am setting a simple rising edge trigger for Channel A using ps2000_set_trigger, with auto_trigger_ms set to 0.
I am using ps2000_run_streaming_ns to acquire data at 1ms sample interval.
I use ps2000_get_streaming_last_values every half second - not for the data but for the trigger.
When the call back reports there has been a trigger I wait 2000ms then stop the acquisition (ps2000_stop).
I then use ps2000_get_streaming_values_no_aggregation to get 2000 samples for channels A & B.
Everything works fine. I see the data starting at the trigger level and continuing throughout the 2000 samples.
This is regardless of whether I trigger immediately or wait for ~10 seconds.
When I try and do exactly the same thing with a pre-trigger (ps2000_set_trigger, 'delay' set to -40%) I have a problem.
The trigger point is still at the start of the data (no pre-trigger data), but the last 40% is garbage or zeroes.
Similar results with other negative values of delay.
With positive values of delay, the data is identical to delay=0.
I have tried the same thing with advance triggers - same result.
Can I collect pre-trigger data with this method?
(I am not collecting data continuously with PS2000_get_streaming_last_values and finding my own trigger point, because I'm using VB.Net and have not been able to access both channels data)
regards Martin
laycockm
Newbie
 
Posts: 1
Joined: Tue Jan 31, 2017 2:43 pm

Re: get streaming values pre trigger

Postby Hitesh » Fri Feb 17, 2017 10:11 am

Hi Martin,

If you are developing your application using a 32-bit driver, please use the PS2000.dll from the PicoScope 6.12 installation directory as there have been some streaming-related fixes. If this does not resolve the issue with the data, please post back here. What is the value for the start_time parameter returned by the ps2000_get_streaming_values_no_aggregation() function call?

A colleague had previously looked into using a Delegate for the fast streaming capture but encountered what sounds like the same issue, so if you need to capture data continuously and process it, then you will need to use the API functions provided by the ps2000Wrap.dll (see this post).

Please e-mail support@picotech.com for updated versions of the wrapper dll should you wish to try this. Due to the low memory of these devices, there is a risk of lost data when using this approach for continuous streaming.

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2196
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: get streaming values pre trigger

Postby laycockm » Fri Feb 17, 2017 11:23 am

Hi Hitesh,
The 32 bit ps2000.dll version I was using was older. Now I am using is 2.2.0.16.
Unfortunately this made no difference.
After the ps2000_get_streaming_values_no_aggregation() call, the 'start time' parameter is 0 regardless of the offset I use (as is the 'TriggerAt' parameter).
Thanks, Martin
laycockm
Newbie
 
Posts: 1
Joined: Tue Jan 31, 2017 2:43 pm

Re: get streaming values pre trigger

Postby Hitesh » Fri Feb 17, 2017 11:33 am

Hi Martin,

Thanks for trying the newer driver.

Could you please post your code here or e-mail it to support@picotech.com so that we can test it here?

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2196
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: get streaming values pre trigger

Postby laycockm » Fri Feb 17, 2017 11:37 am

Hi Hitesh,
My application is much larger than just the PicoScope component.
I am a contractor writing code that uses my clients systems.
It will take me a while to make a subset for just the Pico stuff and send it to you.
Regards, Martin
laycockm
Newbie
 
Posts: 1
Joined: Tue Jan 31, 2017 2:43 pm

Re: get streaming values pre trigger

Postby laycockm » Fri Feb 17, 2017 1:38 pm

Cut down project sent to your support mail address.
Hope it got through - had to change some extension names - failed first time.
laycockm
Newbie
 
Posts: 1
Joined: Tue Jan 31, 2017 2:43 pm

Re: get streaming values pre trigger

Postby Hitesh » Wed Feb 22, 2017 11:58 am

Thanks Martin,

I will run the test and respond via your support ticket.

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2196
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire


Return to .Net Languages (C#, VB.Net, .)

Who is online

Users browsing this forum: No registered users and 0 guests