The SetLineControl method sets the line control register (LCR). The line control register controls the data size, the number of stop bits, and the parity.


BOOL SetLineControl(

    LONG StopBits,     // Stop Bits

    LONG Parity,     // Parity

    LONG WordLength     // Data Bits

);

   

Parameters:

  • StopBits [out] : Number of stop bits to be used. This member can be one of the following values:

ValueMeaning
01 stop bit
11.5 stop bits
22 stop bits
  • Parity [out] : Parity scheme to be used. This member can be one of the following values:

ValueMeaning
0No parity
1Odd
2Even
3Mark
4Space
  • WordLength [out] : Number of bits in the bytes transmitted and received.


Return Values : If the function succeeds, the return value is TRUE, otherwise the return value is FALSE.

Notes:

  1. This method is available starting from Windows 2000 only.
  2. These port settings are actual untill they are not changed by VSP AX or application, which opened virtual serial port. If these settings are changed, you get a corresponding message (in that case OnLineControl event). Be carefull, when you are changing this parameter from VSP AX in event body, as you might get into an endless loop.