![]() Timeout values can be found in the Win32 API documentation. ![]() More detailed information on the communications parameters that are available and the meaning of the ![]() This document is only intended to be a starting point to programmers new to the Win32 communications calls. Your application should be coded with proper exception handling so that once the serial port has been opened it is properly closed when an error occurs. The following code closes the serial port. If ComFile = INVALID_HANDLE_VALUE then įor i := 1 to BytesRead do s := s + d Closing the serial port This is achieved using the Win32 'CreateFile' function. Opening the serial portįirst step is to open the communications device for read/write. This document gives a brief introduction to serial communications under Delphi 2.0 - it does not cover event-driven applications. This varies considerably from 16-bit code as access to the communications ports is achieved through file handles. When writing Delphi 2.0 communications applications it is necessary to use the Win32 interface to the serial ports. Peter has written a number of articles, components and applications, unfortunately the web address we have is no longer valid, if you know where it is now please let us know. This article was written by Peter Johnson.
0 Comments
Leave a Reply. |