streamingtests collects some data now, but still has problem

Post general discussions on using our drivers to write your own software here
Post Reply
jleslie48
Active User
Active User
Posts: 13
Joined: Tue Feb 13, 2007 3:20 pm

streamingtests collects some data now, but still has problem

Post by jleslie48 »

Ok, I can build and run streamingtests.cpp now under Windows_XP.

the final step was replacing the function description to:

void __stdcall StreamingGetOverviewBuffersMaxMin (
short **overviewBuffers,
short overflow,
unsigned long triggeredAt,
short triggered,
short auto_stop,
unsigned long nValues);

in the file streamingtests.cpp the orginal function header and defintion were wrong.

Now I can collect some data, but it appears as if streaming data takes a nap in the middle for some reason. I set streaming tests as follows:

CHannel A 20mv DC
Sampling interval 1
No of samples: 1000000
numerator: 1
denominator: 1

and triggering is off.

When I look at the collected data I get 1000000 samples, but the data appears bad in some sections. For example:

unagregatedData[0][000000-032511] seems fine.
unagregatedData[0][032512-065023] are all but one bit set, value 32767
unagregatedData[0][065023-687841] seems fine.
unagregatedData[0][687841-999999] are all bits set, value -32768

FWIW,

my machine is a pentium 4 running windows_XP, 3.00GHz, with 2GB of RAM.

teck
Active User
Active User
Posts: 17
Joined: Sun Feb 25, 2007 4:48 pm

Post by teck »

Hi jleslie,

Great that u finally got it working. I still couldnt get the streamingtest.cpp to run. is it possible to upload a copy for reference here?

Thanks.

jleslie48
Active User
Active User
Posts: 13
Joined: Tue Feb 13, 2007 3:20 pm

Post by jleslie48 »

ok heres my backup:

http://jleslie48.com/picoscope/PS3000_71.zip

start with the readme file.

hopefully we can move this forward.

Sincerely,

Jonathan

jleslie48
Active User
Active User
Posts: 13
Joined: Tue Feb 13, 2007 3:20 pm

Post by jleslie48 »

OK, here's my latest.

I collect with streamingtest 5,000,000 samples. The sampling seems to
start just fine:

Image
note the red acknowledgement of data.

But then it seems to drop out:


Image

But then it sporatically returns:

Image

Heres a screenshot of the data I've collected:

Image

And a matlab plot of all 5,000,000 points:

Image



Help!!!!

jleslie48
Active User
Active User
Posts: 13
Joined: Tue Feb 13, 2007 3:20 pm

Post by jleslie48 »

today I tried to compile and link the program in release mode hoping that maybe the debug mode and its inherent slower operation were causing the loss of data.

No such luck. the release version shows the same loss of signal.

I also notice that while I am collecting 5 seconds worth of data, the GUI screen takes as long as 30 seconds to acknowledge the collection. I am quite sure that the data being shown is in fact the first 5 seconds, but the screen lag got me thinking. Maybe its all that GUI interface stuff that is slowing down the process and as a result streamingtests.cpp is not able to keep up with the fast_streaming process.

Can someone strip streamingtests.cpp down to its bare minimum, viz, get rid of all the gui junk, so that it is not updating the screen, etc.?

My version already makes use of PC memory to hold the 5,000,000 samples, (so it is as fast as possible) and doesn't even consider writing out the data to disk until after the 5 seconds of data is recorded, What has to be done to strip this program down to its bare bones so nothing interferes with the the transmission of data from the picoscope???

teck
Active User
Active User
Posts: 17
Joined: Sun Feb 25, 2007 4:48 pm

Post by teck »

Hey, thanks jonathan! manage to get the cpp compiled.

I also realised that the gui is slowing everything down. My application needs streaming to be fast. I was thinking we can do without the display of the screen, and just collect the data to store to a file. any opinions on that?

In addition, i realise that the screen (user interface) hangs when we click or drag the mouse cursor when it is streaming... how do we solve this!!?

jleslie48
Active User
Active User
Posts: 13
Joined: Tue Feb 13, 2007 3:20 pm

Post by jleslie48 »

If you ask me, we strip it out. I don't want any of the GUI stuff.
All I want is the data. As you can see in my version of streamingtests.cpp,
I just dump the 5,000,000 element array to an ASCII file, (BTW, if you get
rid of my goofy graph the sample data file reduces to 90MB. Quite a bit of savings over the 600mb datafile. Although, the 600mb file does zip down to 15mb, while the 90mb file zips to 12mb)

The graph and values is what I care about, not the goofy screen that I think is killing the data collection.

There is also something magical about the value 32512. I notice that number popping up a lot. as in when I first turn on the fast streaming, I collect 32512 samples, then I take a nap for either 1x, 2x, or 3x 32512 samples, and then I return to getting samples for about 600,000 samples.

My point is someone who knows about the Picoscope internals should be woken up by the value 32512, aka, its a buffer size, or a buffer size less some header packet, or something along those lines. Here's another hint,
2^16 == 32768, an important number in this system, 32768-32512 ==

254

254 as a header packet?? its awfully close to 256, aka 2^8. I don't know, maybe its nothing, but I suspect these values will trigger one of the developers noggins.

Meantime, I've never developed in VS C++, and all this GUI stuff is very forriegn to me, so stripping it out is a bit of an effort to me, I'll be looking at it this weekend.

Meantime if anyone can do it or even better, make a nice simple DOS/ Console version (like ps3000con) that works I'd love that. Hopefully with a nice complete MAKEFILE so I never have to deal with MS VS again!!!

( a 7 CD compiler and linker... good lord...)

jleslie48
Active User
Active User
Posts: 13
Joined: Tue Feb 13, 2007 3:20 pm

streamtests is working!!

Post by jleslie48 »

ok I got a workaround to the missing data, but I don't know why it works.


If I set the denominator to 10, then I don't drop any data for the 5 seconds.

What is the denominator setting for?

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

Post by markspencer »

Hi,

I am sorry to hear that you are experiencing problems with the fast streaming example.

I will try to give you a run down on the example and how it works.

When you set the interface, for the sampling Setting | Sampling... there are 5 boxes that need to be completed.

Sample Interval: The time between each sample.

Sample Time Units: The units that the sample interval are in this can range from Nano Seconds to Seconds.

NoOfSampels: The number of samples the driver is to take and store.

Denominator: The number of samples taken from the device to one sample to be returned to the GUI.

Therefore, if you are collecting 1,000,000 samples and have a denominator of 1000, then you would recieve 1,000 sample to display on your GUI. The reason that you would use the denominator is to reduce the processor time on displaying data, which also makes it easier to look at the data as it appears on the screen.

Once the streaming has finished then the denominator can be changed and the data mined into.

AutoStop: If true the streaming will stop after collecting the number of samples stated in the sampling window, otherwise the streaming will continue until there is user intervention.

When the streaming is started the information provided in the sampling window is used in the following function:

short ps3000_run_streaming_ns (
short handle,
unsigned long sample_interval,
PS3000_TIME_UNITS time_units,
unsigned long max_samples,
short auto_stop,
unsigned long noOfSamplesPerAggregate,
unsigned long overview_buffer_size )

The noOfSamplesPerAggregate is the denominator value from the sampling window.

Missing values: The reason missing values occur is that the device is running faster than the PC can aquire and process the data. To avoid this you can increase the sample interval, increase the aggregation value (denominator) or a combination of both.

I hope this provides you with the information required.

Best regards,
Mark S.
Regards,

Mark Spencer

jleslie48
Active User
Active User
Posts: 13
Joined: Tue Feb 13, 2007 3:20 pm

Post by jleslie48 »

Mark,

Thanks for your input.

I had figured out by trial and terror that changing the denominator will significantly improve the ability of streaming tests to collect my samples without dropping any data.

This is a very useful tool for environment testing to be able to collect long samples of data at operational time intervals. You folks have my engineering staff waiting in line to use the Picoscope and shelving the the $20,000 Oscilloscopes.

Post Reply