TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:4268] interfacing project



At 08:50 PM 2/20/99 -0600, you wrote:
>I'd like to write some software to control their serial interface box
>(http://www.vernier.com/mbl/uli.html). I'm trying to learn Python and
>would like to use it for this project. What I don't know is what I've
>gotten myself into. So my question is:
>
>What will be required for this project?

You can find good analysis packages out there... many of which that can do
statistical tests to be sure your samples are bad.  Basically you need a
something to:
	1. chat with external hardware
	2. grab and store data
	3. convert it to a format suitable to your analysis packages.

There are some hard requirements for these.  Usually #1 and #2 go thru the
same point (to talk to the device), store the data in a shared area, and a
seperate thread (or process) picks up the data and stores it on disk.
These first part almost always has have its code and data locked into
physical memory (to prevent failure modes and timing slop of paging), and
scheduled at a higher rate (to prevent fighting with other tasks).  There
are some decent books on this (and how to lay out the program) , but I
don't have their names right now.

Here is a site that describes a similar topic (instrumenting the CPU and
OS) http://pel.cs.byu.edu/
which will be useful for seeing the structure of such problems.

Some Linux-specific science stuff can be found at:
http://www.linuxhq.com/cgi-bin/viewcatg?Science:Lab

There is also a linux lab project, but I don't remember where that is...

>Do I need to learn C so I can write a device driver?

Yes, if you need to write a device driver.  You probably don't a kernel
device driver since it will work over a /dev/ttySx.  You can (probably) use
Python or PERL, or such to do the format conversion.  But you will need
something to do the above linking to the hardware, and it will probably
have to be in C for size, control, determinism, and such.  C++ has been
used, but tends to get shunned due to undeterministic behaviour in many
critical areas (traditionally memory in these sampling programs is
allocated only at start up time, and pinned down -- to provide rock solid,
predictable behaviour.  Many libraries and C++ can dynamically reallocate
or move memory structures, which requires a greater degree of skill and
variety of adaptive techniques on the designers part).

Best of luck,
Randy Maas
randym@acm.org