get streaming values pre trigger

Post your .Net discussions here
Post Reply
laycockm
Newbie
Posts: 1
Joined: Tue Jan 31, 2017 2:43 pm

get streaming values pre trigger

Post by laycockm »

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

Hitesh

Re: get streaming values pre trigger

Post by Hitesh »

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,

laycockm
Newbie
Posts: 1
Joined: Tue Jan 31, 2017 2:43 pm

Re: get streaming values pre trigger

Post by laycockm »

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

Hitesh

Re: get streaming values pre trigger

Post by Hitesh »

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,

laycockm
Newbie
Posts: 1
Joined: Tue Jan 31, 2017 2:43 pm

Re: get streaming values pre trigger

Post by laycockm »

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

Post by laycockm »

Cut down project sent to your support mail address.
Hope it got through - had to change some extension names - failed first time.

Hitesh

Re: get streaming values pre trigger

Post by Hitesh »

Thanks Martin,

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

Regards,

Post Reply