Test and Measurement Forum

Sample number and graphical output

Post your .Net discussions here

Sample number and graphical output

Postby Stevo » Tue Jul 24, 2012 3:39 pm

Hi there again,

On to my last hurdle =). My project involves making a interface screen where data points are acquired and then the graph is displayed for the user to see the incoming signals. This is pretty much mimicking the picoscope 6 interface. I can vary the time divisions, vertical scale, etc.

My approach has been to use the block mode transfer and this seems to be working so far. Please correct me if I should be using one of the other approaches (rapidblock or streaming). I believe that as the user switches to slower sample rates, streaming would eventually be used - but I'll leave that for later =)

My question concerns the number of sample points I am using. I am using between 1000-2000 sample points (one single buffer) but I suspect this is causing me to occasionally miss or be late in catching a trigger value hence the rare glitch when viewing a stable signal. As I increase the sample points (say 10K, 100K, 1M) my functions that perform the draw operations to graph the output become VERY slow since there are loops that must process each data point. Am I missing something here?! I know that grabbing the data at 1M samples is doable since when I comment out my 'draw' functions, my debug output indicates data capturing is speedy. Is there some 'special' way to implement the output so I'm not limited to using small sample sizes? Will switching to rapidblock mode using segments accomplish this (ie. draw small chunks at at time?). I have been having trouble getting the segement/#captures/buffers working under rapid mode so I wanted to make sure on this forum before I attempt it again. I'm not sure which approach is correct and any suggestions would be extremely helpful!

I know programming wise it must be doable since the picoscope6.0 software can do show its output so smoothly using very high number of samples.

Thanks once again
Stevo
Newbie
 
Posts: 0
Joined: Mon Mar 26, 2012 6:12 pm

Re: Sample number and graphical output

Postby Stevo » Wed Jul 25, 2012 8:04 pm

Just wanted to update: I was able to resolve this speed issue by optimizing some of the draw codes. For example, in order to scale the output to an output box I used buffer.max and buffer.min multiple times. While I wasn't sure what VB.net did in the background, I timed the execution code and realized that both these functions occupied a large chunk of time - likely an internal loop. Storing these variables and using it later solved the problem.
Stevo
Newbie
 
Posts: 0
Joined: Mon Mar 26, 2012 6:12 pm

Re: Sample number and graphical output

Postby Martyn » Thu Jul 26, 2012 6:53 am

You are on an interesting journey there. Post back if, or should I say when ;) you have more questions. Most issues will probably have been encountered by our developers over the years ;)

One of our latest drawing related issues is the filtering of signals whilst still streaming data at sensible speeds, and this is dependant on PC performance.
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2350
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots


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

Who is online

Users browsing this forum: No registered users and 0 guests