Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Detecting Com Port Settings ...

Posted on 2000-03-28
1
Medium Priority
?
269 Views
Last Modified: 2010-04-04
Hi,

I have an old Delphi program (Compiled EXE only) which communicates via the serial port.

I need to get something talking to it, but I don't know the settings ...

Is there any way to get the com port settings whilst the program is running ?

Any help would be appreciated.

James
0
Comment
Question by:James Atkin
1 Comment
 
LVL 7

Accepted Solution

by:
ahalya earned 300 total points
ID: 2664674
You can call the "GETCOMMSTATE" WinAPI to retrieve info about the current settings:  (I assume that you want to do it using programming)

 (the following info From Delphi files will be useful in that case)

function GetCommState(hFile: THandle; var lpDCB: TDCB): BOOL; stdcall;


the var DCB points to the following structure.

type
  TDCB = packed record
    DCBlength: DWORD;
    BaudRate: DWORD;
    Flags: Longint;
    wReserved: Word;
    XonLim: Word;
    XoffLim: Word;
    ByteSize: Byte;
    Parity: Byte;
    StopBits: Byte;
    XonChar: CHAR;
    XoffChar: CHAR;
    ErrorChar: CHAR;
    EofChar: CHAR;
    EvtChar: CHAR;
    wReserved1: Word;
  end;
  PDCB = ^TDCB;
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Screencast - Getting to Know the Pipeline
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question