Help needed!!!! Reading data by RS 232 - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Help needed!!!! Reading data by RS 232

zepledzepled Posts: 9Member
[b][red]This message was edited by zepled at 2003-4-23 4:31:35[/red][/b][hr]
Hi,

I am using an AD converter with an interface for the RS232 port and want to transmit data to the PC. Could someone tell me how to program the data transmission to the computer by the RS232 interface (I am working under DOS)? Maybe, someone has a sourcecode that works.

Thanks in advance,

zepled.


Comments

  • ibyiby Posts: 323Member
    there are many code samples if you search for "async".
    few of them you will find on this page as well...


  • ibyiby Posts: 323Member
    actually I've found something that you might find interesting.
    it uses [b]async[/b] unit written by Patrick Hunlock
    (just check the web using say Google...)

    [code]
    program sample; { Dumb Terminal }

    uses async,crt;

    var
    c: char;
    { com1: com_port;{}
    com2: com_port;

    begin
    com2.init(1,10000,10000); {set up the buffers & interrupt }
    com2.setparam(9600,8,'N',1); {set up the baud,ws,parity,&stopbts}
    com2.enable; {enable the com port }
    c:= ' ';
    {initialize the scratch variable }
    ClrScr;
    TextColor(15);
    writeln('Dumb terminal version 0.1');
    TextColor(10);
    writeln('Use crossover cable between COM1 ports of two PCs:');
    writeln(' 2----3 Use DB9F for connectors. ');
    writeln(' 3----2');
    writeln(' 5----5');
    TextColor(15);
    writeln('Press ESC to exit program:');
    repeat
    if keypressed then begin
    c:= readkey;
    textcolor(9);
    write(c);
    if ord(c)=13 then writeln;
    if c <> #27 then com2.write(c);
    end;
    if com2.waiting then begin
    textcolor(14);
    write(com2.read);
    end;
    until c = #27;
    com2.done;
    textcolor(7);
    end.
    [/code]



Sign In or Register to comment.