Reduce Sample Number in Streaming Mode

Post your C and C++ discussions here
Post Reply
zipcode
Newbie
Posts: 0
Joined: Wed Dec 05, 2018 8:54 am

Reduce Sample Number in Streaming Mode

Post by zipcode »

My question is the following: I am running the 4444a in streaming mode and I want a reduce the number of samples , how can be made?
In this case I want 1 sample every 250ms,during a long period of time.

Code: Select all

uint32_t sampleInterval=250
ps4000aRunStreaming(unit->handle, &sampleInterval, PS4000A_MS, preTrigger, postTrigger, autostop, downsampleRatio, ratioMode, buffLength);
..
...
GetStreamingLatestValues(unit->handle, CallBackStreaming, &bufferInfo)
When the callback is made from StreamingLatestValues, the g_sampleCount variable has a value of 64. Is it possible to reduce this number?

zipcode
Newbie
Posts: 0
Joined: Wed Dec 05, 2018 8:54 am

Re: Reduce Sample Number in Streaming Mode

Post by zipcode »

I'm trying to use ps4000aGettimebase(). With this function i can specify the number of samples and the time interval between readings. Can this be used in streaming mode?
I know that I can specify the time interval between readings when I call ps4000aRunStreaming() but not the number of samples.

Martyn
Site Admin
Site Admin
Posts: 4499
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Reduce Sample Number in Streaming Mode

Post by Martyn »

You don't need to use GetTimebase, that is for Block Mode, you specify the sample interval directly in the streaming function together with the time units. sampleInterval will need to be 250, and time units PS4000A_MS, with pre and post trigger samples set to what you need. and with autoStop set to false it will stream indefinitely.
Martyn
Technical Support Manager

Post Reply