SetLineControl Method

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:
    Value Meaning
    0 1 stop bit
    1 1.5 stop bits
    2 2 stop bits
  • Parity [out] : Parity scheme to be used. This member can be one of the following values:
    Value Meaning
    0 No parity
    1 Odd
    2 Even
    3 Mark
    4 Space
  • 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.