>Anyone got a decent unit for changing/setting the COM port parameters?
>
>Thanks in advance!
>--
>John DeRose cs108069@pandora.sdsu.edu
>Computer Science Undergrad
>
The following code is a text device driver that allows you to assign a COM port to a "text" type file and do i/o with the regular read/write statements, etc. The only visible procedure is AssignAux which sets the parameters of the serial port.
This unit, based on an example in the TP4.0 manual, was used for driving a serial plotter and I have embedded in it various prompts and visual confirmation that data *is* going out of the port.
center_write('Plotter not accepting data.', wherey+1);
center_write('Press <space> to resume when setup corrected, <Esc> to quit.', wherey+1);
buzz;
dec(textattr, blink);
repeat
ch := readkey
until ch in [' ', #27];
if ch = #27 then abort;
dsr := (auxinit(port,params) shr 4) and 3;
ready := dsr = 3;
gotoxy(1, wherey-2);
end;
gotoxy(1, wherey+1); clreol;
gotoxy(1, wherey+1); clreol;
with textrec(f) do begin
handle := $FFFF;
mode := fmClosed;
bufsize := sizeof(buffer);
bufptr := @buffer;
openfunc := @auxopen;
auxrec(userdata).port := port;
auxrec(userdata).params := params;
name[0] := #0
end
end; { assignaux }
begin
end. { unit AuxInOut }
------------------------------cut here-------------------------------*****************************************************************david@vims.eduDavid A. Evans,School of Marine Science, Virginia Institute of Marine ScienceCollege of William and MaryGloucester Point, Virginia, USA*****************************************************************