Re: serial port communication qestion...



On Aug 22, 7:17 pm, cooper...@xxxxxxxxx wrote:
hi everyone,

i am a beginner of pascal language. nowadays, i am learning to deal
with serial port.
i found some examples, such as opening port, writing to port:

eg.
//SerSetParams(MySerialHandle, 9600,8,EvenParity,1,[]);
//SerWrite(MySerialHandle, bffr,2);

my question is why the 'MySerialHandle' argument appears in these
command.
what is the purpose of this argument?

MySerialHandle is the unique "handle" returned from the open for the
serial device. Remember, you can have more than one serial device, so
there has to be a way to distinguish them. The "handle" is just the
way the code distinguishes between opened serial devices.


.



Relevant Pages

  • Re: Is any device connected to COM1 port
    ... Here is an updated routine that doesn't always wait 1 second for each port: ... ' TimeOut Time out in seconds to wait for the serial device to come ... On Error GoTo ErrorHandler ... > Private Sub Form_Load ...
    (microsoft.public.vb.general.discussion)
  • Re: COMM control refresh
    ... line which was supposed to close the port so it can be opened again. ... > ' CommPort CommPort to check. ... No serial device attached or powered off ... > Private Sub Timer1_Timer ...
    (microsoft.public.vb.general.discussion)
  • Re: Data sticks around on serial port between program runs
    ... >data from the previous run (The serial device sends its data all at ... >the port in my program and in a cleanup function when the program ... >exits, before closing the port. ... Typically tcflush() would do the trick, ...
    (comp.unix.programmer)
  • Re: Locking a COM port
    ... >trying to port something I wrote with TP7 DOS to Windows with Delphi ... this serial device will stop functioning properly if ... My understanding is that once a Com port has been opened by one App, ...
    (comp.lang.pascal.delphi.misc)
  • Re: Serial -> Parallel connection?
    ... I thought it was a stupid question because USB is a serial device, while parallel gives eight bits on 8 separate lines. ... I have an old desktop machine running Wndows 98 which does have a parallel port. ... Is there a dongle I can get to hang on its USB port to network to the Dell, thus allowing me to print to the HP via the network. ...
    (comp.periphs.printers)