Test and Measurement Forum

Picoscope 4424/4000 Series

Post any questions you may have about our current range of oscilloscopes

Picoscope 4424/4000 Series

Postby spyguy33 » Tue Nov 03, 2009 8:20 pm

I'm trying to make an use the Picoscope 4424 through the SDK, to provide the same functionality as the Picoscope 3000 series SDK provided. For my purposes, I only need to use Block mode. I am able to do everything, including setting the trigger and receiving the data from the Picoscope, however I haven't found the equivalent ability as the picoscope 3000's delay option in ps3000_set_trigger(). I see that there is a ps4000SetTriggerDelay, that accepts a ulong for a delay, however this is not seeming to be the same thing as what the 3000 provided. Unfortunately the only example that mentions a delay in percentages is in PS4000con.c:965. This however doesn't seem to actually tell how to do it, nor does it confirm how it is done. I also notice the use of a function called ps4000SetEts, which is nowhere in the programming manual. Is there a more extensive manual available for these 16 undocumented functions, or are these experimental? If someone could help me, I would be very greatful.
spyguy33
Newbie
 
Posts: 0
Joined: Tue Nov 03, 2009 8:09 pm

Re: Picoscope 4424/4000 Series

Postby Erik » Wed Nov 04, 2009 8:34 am

The file which has the information you are looking for is called "ps4000pg.en.pdf".

The functions that setup the trigger include but are not limited to.

ps4000SetTriggerChannelConditions
ps4000SetTriggerChannelDirections
ps4000SetTriggerChannelProperties
Erik
PICO STAFF
PICO STAFF
 
Posts: 52
Joined: Mon Oct 23, 2006 8:16 am
Location: Cambridgeshire, UK

Re: Picoscope 4424/4000 Series

Postby spyguy33 » Wed Nov 04, 2009 1:55 pm

ps4000SetTriggerChannelConditions, ps4000SetTriggerChannelProperties, and ps4000SetTriggerChannelDirections specify the rules by which a trigger will occur. These do not specify how to set a delay as to how much data occurs before the trigger vs. the amount of data that is displayed after the trigger. For example from the PicoScope 3000 series:

ps3000_set_trigger (
short handle,
short source,
short threshold,
short direction,
short delay,
short auto_trigger_ms )

Where the delay is a number from -100% to +100%.

The document that I have been referencing is ps4000pg.en.pdf with a date of 8/18/2009 1:04PM. This document does not cover the following methods referenced from the sample code:

ps4000OpenUnitEx
ps4000OpenUnitAsyncEx
ps4000SetSigGenArbitrary
ps4000SetSigGenBuiltIn
ps4000SigGenSoftwareControl
ps4000SetETS
ps4000SetDataBufferWithMode
ps4000SetDataBuffersWithMode
ps4000SetETSTimeBuffer
ps4000SetETSTimeBuffers
ps4000RunStreamingEx
ps4000SetProbe
ps4000GetProbe
ps4000GetChannelInformation
ps4000SetFrequencyCounter
ps4000EnumerateUnits

In addition to wanting to set the delay, I was also wondering if there is a way to set a int buffer for the times as used in the PS3000 function getTimesAndValues. I suppose that I could generate this myself, if I had to, but it was nice having the scope tell me when the trigger occurred (the time of value 0), esp. since it varied by a little bit.

Help would be appreciated.

Thanks.
spyguy33
Newbie
 
Posts: 0
Joined: Tue Nov 03, 2009 8:09 pm

Re: Picoscope 4424/4000 Series

Postby Erik » Wed Nov 04, 2009 2:18 pm

Hi,

I believe some of the functions in the example program might be leftovers from a version for the ps3000,ps5000 range. For example the ps4000 does not have a signal generator so those functions are not available for the ps4000.

The trigger point within a capture is set by the noOfPreTriggerSamples and noOfPostTriggerSamples arguments to the function ps4000RunBlock.

The trigger delay is set separatly with the ps4000SetTriggerDelay function. The trigger delay is the time from the real trigger event to the point within the capture.

Insted of using getTimesAndValues, I think you need to use ps4000GetTriggerTimeOffset.

Regards
Erik
PICO STAFF
PICO STAFF
 
Posts: 52
Joined: Mon Oct 23, 2006 8:16 am
Location: Cambridgeshire, UK

Re: Picoscope 4424/4000 Series

Postby spyguy33 » Fri Nov 06, 2009 3:22 pm

Thanks,

That solved that problem, however I think that I have found a bug in the driver. It had been causing me grief for the last few days.

In the past on the 3000 series scopes, I never used the "getTimebase" function, because I calculated all other information on my own. Which this is fine, because that is only supposed to be the way to determine what timebase to use. You are supposed to specify the timebase in the "runblock" method. Given that you did everything correctly, it should work as normal.

In the 4000 series, you MUST use the "getTimebase" method, because otherwise (maybe always) it completely ignores the argument "timebase" in the runblock command. The second bug, is if you use the getTimebase function, make sure that you set the oversample to 1. If you set it to 0, the function will return a 0 or PICO_OK, but the data that is returned is non-sense.
spyguy33
Newbie
 
Posts: 0
Joined: Tue Nov 03, 2009 8:09 pm

Re: Picoscope 4424/4000 Series

Postby markspencer » Mon Nov 09, 2009 9:48 am

Thank you for your post, I have examined the PS4000 driver and can confirm that the oversample bug does exist. This has now been fixed and will be available in the next sdk release, unfortunately I have not got a time scale for this release.

However, I can not reproduce the bug you reported when not calling GetTimebase and calling RunBlock the timebase variable being ignored. There is no correlation between these two functions. The GetTimebase will check the settings that you have passed and validate the timebase and other settings you wish to use. When calling the RunBlock the parameter values that you call this function with will be validated again and the PS4000 set to sample at this rate. If you are having further problems with the timebase and RunBlock please provide further information, eg, number of channels set, timebase, no of samples, oversample etc.

Best regards,
Regards,

Mark Spencer
User avatar
markspencer
Site Admin
Site Admin
 
Posts: 598
Joined: Wed May 07, 2003 9:45 am

Re: Picoscope 4424/4000 Series

Postby Peyman » Mon Oct 25, 2010 8:22 pm

could you please let me know how Ican use "ps4000GetTriggerTimeOffset64" in rapid block mode using PS4000?
I tried this function however, it gave me some starnge numbers.

how should I specify timeUnits in this function?

I really appreciate if you provide me with a code to capture trigger time for in rapid block mode with lets say 120 waveforms.

your help is much appreciated,

thanks,
peyman
Peyman
Newbie
 
Posts: 0
Joined: Sun Oct 03, 2010 5:40 pm

Re: Picoscope 4424/4000 Series

Postby Chris » Wed Oct 27, 2010 5:08 pm

Hi Peyman

There is an error in the driver, but this can be worked around by setting the timeUnits value to 0;


__int64 time64;
PS4000_TIME_UNITS timeUnits=0;
unsigned short segmentIndex=0;


status = ps4000GetTriggerTimeOffset64(unit->handle, &time64, &timeUnits, segmentIndex);
Chris
Site Admin
Site Admin
 
Posts: 169
Joined: Tue Aug 17, 2010 9:00 am
Location: St. Neots


Return to USB PC Oscilloscopes

Who is online

Users browsing this forum: No registered users and 0 guests