[LCP] In-field program task

Kevin Shackleton kevins at bbsat.com.au
Fri Jun 6 10:58:07 EST 2008


Dear c-programming-ers,

After working in another language for from whenever it was that Turbo
something-or-other was launched I have been brought around by my eeepc
to needing to work in c.

Of course I've done bits of c before, but now it's in Linux and this
project is about interactive processing, which I've not done much of.

I bought a VIOM
(http://www.oceancontrols.com.au/controllers/phaed/viom.htm)
device to look at working an automatic livestock drafting race.  The
VIOM is a PIC-controlled I/O board that does things like programmable
delays on outputs.  I need to trigger outputs on certain incoming serial
data.  Unfortunately it does not do the output delays when the output is
set to be controlled by the serial port - buyer beware, I feel a bit
dumb for not having closely read the manual before parting with cash :-(

So I'm looking at using the eeepc (only a _bit_ dearer than the VIOM!)
to receive and decode serial input from weighing scales that compute
drafting, and send serial output to the VIOM to work my draft gates.
Something like: Receive message to draft to "1" > open draft gate "1" >
open weighing box exit > wait 3 seconds > close weighing box exit > wait
3 seconds > close draft gate "1" > stand by (loop).  An open-loop
situation but that seems to be ok with the industry, and there will be
manual overrides.

I have a number of levels of enlightenment to pass through to achieve
this result.  Where I am now is:

 - I need to figure out what ioctl is all about so I can set up to parse
character by character input, rather than expecting a newline to flush
the buffer.

 - At the moment I'm using standard input and output, but I'll need to
do this task on ttyUSB0 and ttyUSB1.  Which means using termios.h

Both these libraries are a total black box to me.  "man ioctl" doesn't
do anything.  How to I figure out what to do next?

Maybe <flame protection> c is not the best environment to do this work
in? </flame protection>

Thanks,

Kevin Shackleton
Dandaragan, WA




More information about the linuxCprogramming mailing list