Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It turns out I was using the wrong function, I should have been using <a href="http://msdn.microsoft.com/en-us/library/aa363262%28VS.85%29.aspx" rel="nofollow noreferrer">GetDefaultCommConfig</a> and not the <a href="http://msdn.microsoft.com/en-us/library/aa363256%28VS.85%29.aspx" rel="nofollow noreferrer">GetCommConfig</a> that I was using.</p> <p>By the look if it, and please correct me if I am wrong, GetDefaultCommConfig returns the settings from windows and GetCommConfig returns the settings of the open connection to the port, writefile opens the port up as it see fit (ignoring the default settings), which is where the 1200 baud rate was coming from.</p> <p>If this helps anyone in the future, here is the function I came up with.</p> <pre><code>function ComPort(l_port:String):TCommConfig; {Gets the comm port settings (use '\\.\' for com 10..99) } var size: cardinal; CommConfig:TCommConfig; begin FillChar(Result, SizeOf(TCommConfig), 0); //strip trailing : as it does not work with it if (RightStr(l_port,1) = ':') then l_port := LeftStr(l_port,Length(l_port)-1); try FillChar(CommConfig, SizeOf(TCommConfig), 0); CommConfig.dwSize := sizeof(TCommConfig); size := sizeof(TCommConfig); if (GetDefaultCommConfig(PChar(l_port),CommConfig,size)) then begin Result := CommConfig; end //if port is not found add unc path and check again else if (GetDefaultCommConfig(PChar('\\.\' + l_port),CommConfig,size)) then begin Result := CommConfig; end except Showmessage('Unable to open port ' + l_port); end; end; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload