> machine of a mill to the computer. It is connected to the serial port. I
> am working in windows OS. Now i want to read the readings from that port
> into a file. I need it very urgently as the next part is based on this
> itself...you have written that you have C code for initialising and
> reading from serial ports written in DOS. sir, if you provide those
> codes i would be grateful to you sir


To read a serial port into a file simply use:

  cat /dev/ttyS0  > somefile.txt

To put the data in a file and watch what happening use:

  cat /dev/ttyS0  | tee somefile.txt


To write your own program simply open /dev/ttyS0 and read/write it just
like any other file.

To keep nomral linux frop dropping serial data at high rates when writing
to the disk use:

hdparm -u1 /dev/hda

Execute as root and do it for each drive on your system.

To easily change baud rate, parity, handshaking, and everything else study
the stty command.  

To set the baud rate use:

  stty 115200 </dev/ttyS0
or
  stty 9600 </dev/ttyS0


To set hardware handshaking, raw 8 bit data, no echoing, 115,200 baud use:

  stty 115200 -echo raw crtscts </dev/ttyS0

To see how to do change any serial port settings do a man stty.

To see what the state the rs-232 lines are in, check out the statserial
command.   More info with man statserial.


C. Wright


-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/

Reply via email to