Re: need data capture, stat analysis, graph display software for PC




"colin" <colin.rowe1@xxxxxxxxxxxxxxxxxx> wrote in message
news:gNEMh.17020$2F5.756@xxxxxxxxxxxxxxxxxxxxxxx
"John Barrett" <ke5crp1@xxxxxxxxxxx> wrote in message
news:KkEMh.10713$8B1.2712@xxxxxxxxxxx

"colin" <colin.rowe1@xxxxxxxxxxxxxxxxxx> wrote in message
news:qADMh.3857$5c2.2686@xxxxxxxxxxxxxxxxxxxxxxx
"John Barrett" <ke5crp1@xxxxxxxxxxx> wrote in message
news:ieDMh.10703$8B1.9129@xxxxxxxxxxx

"colin" <colin.rowe1@xxxxxxxxxxxxxxxxxx> wrote in message
news:GWAMh.14723$B37.1222@xxxxxxxxxxxxxxxxxxxxxxx
Ive just installed the C# from microsoft as it seems to be free !
C# looks promising too.

Colin =^.^=
\

Ahh you must have found the "express" version or whatever they are
calling it lately -- that'll get you there :)

feel free to drop email on me if you have C# specific questions.

yep it was quite surprising to find it, I expected it to be limited.
wonder why they giving it for free, must be becuase it ties you into
windows easily with .net.

admitedly it wouldnt let me instal it to my e: drive where I had space
it still decided to try and plonk 1.3gb on my c drive wich is now full,
even though I specified a dir on e:

lets you generate an application in 60 seconds
wich is fine if all you want to do is have a button
wich changes a label to "hello world" when you press it.

I already have com port open so it puts lines from com4 into where the
hello world was
when you preess the button lol, so thats 30% of the way there.

I think il just have to massage the data and interpolate between points
wich I have to reject as glitches.

There are some FFT libraries too thats another 30%,
google came up with one that looked like it would do,
dont know if there are any recomendations available?
although I dont fully understand the FFT terminology used exactly,
I know how to use a DSP to do one though lol.
does the PC have real DSP capabilities wich it uses or just a normal but
fairly quick FPU?
im runing with an AMD64bit CPU.

I have also moved the com port to a new task/thread for reading
and handled acess denied exceptions when it wont open.
atm im looking for a good way to pass the data from the com task to the
processing task.
I gues a stream or a pipe or whatever its equivalent is in c#.net
Il probably find that too, just take a bit more time looking than the
other stuff did so far.

Im sure il find a c# graph library too,
again maybe has some prefered ones.

Colin =^.^=


FPU based -- no on-board DSP :)

for the data transfer -- look at the System.Collections.Generic
namespace -- create a class that represents a block of FFT ready data..
have the com port thread assemble the block, and when ready.. push the
block into a typed queue (generics are like C++ templates.. let you
create collections of typed objects with full compile time type checking)


The com thread needs to be real quick as it needs to timestamp each line
to 10ms resolution if possible,
itl just do that and also split it into seperate chanells for fft data and
housekeeping data, errors etc.
and save it in files. the PIC is short of a RTC with proper time.
the fft thread has to read any old data stored in files then add the new
data from the com port
thread then do number crunching every so often on the data collected so
far.

use the "lock" statement to wrap your push and pull methods so that
access to the queue is serialiized, and optionally create an event to
notify the UI code that there is a block of data ready to process. (or
use a timer to poll for data -- whatever you are comfy with)

thanks that 'lock' sounds like what I need,
of course I could just use the files to transfer data ..
just make them each hold chunks of 10 minutes or so they are finished
with by the com thread before the fft thread gets to them,
but the lock would make me free to make them longer.
im sure theres probably simple pipe type class wich uses the thread lock.

Note that C# gets pissy when you attempt to access UI elements from a
thread other than the one that created the UI -- look at delegates and
the Invoke method to work around the issue if you need the background
thread to access the UI.

yeah thats just like mfc, it used temp data objects wich arnt garanteed to
not have been destroyed when other threads are running.

You might want the FFT and any other data crunching on the com thread or
even a seperate cruncher thread so the UI just has to deal with
displaying ready-to-render data.

sounds like you are off to a running start, though !! glad to see you are
slipping into C# so quickly :)

(ohh and the Mono system for *nix will run dotNet code -- so you really
arent all that locked in to MS with C# any more )


Cool thanks, yeah I get up to speed real quick I gues,
but only if i can find the enthusiasm though and then thats either on or
off with little inbetween
I just bualk at the idea of trying to go through loads of new things
trying to evaluate them,
ive tried that before and it can realy suck.

Colin =^.^=



I was thinking more realtime than logging to files -- think about having the
com thread pump the data to a writer thread in that case :) sounds like you
may end up with 3 or 4 threads sharing the load, which is a good thing
IMO -- as threads that are idle dont take resources -- event driven makes
life much simpler

might also look at the background worker class -- it encapsulates a lot of
the crap for starting a worker thread as needed and getting notified when it
completes



.


Quantcast