About PortController
Introduction
Purchasing PortController
Redistributing PortController
License Agreement
Support
Getting Started
How to Use PortController
PortController Sample Projects
Handling PortController Errors
Reference
Properties
AvailableSystemPorts
BaudRate Property
Break Property
BytesUsedRQ Property
BytesUsedTQ Property
Cd Property
Cts Property
DataBits Property
Dsr Property
Dtr Property
DtrDsr Property
EnableReadOnEventChar Property
EventChar Property
ForceBeginInvokeEventFiring Property
IsOpen Property
IsFileTransferInProgress Property
Parity Property
PortHandle Property
PortName Property
ReceiveBufferSize Property
Ring Property
Rts Property
RtsCts Property
StopBits Property
SystemPorts Property
TraceOutput Property
TransmitBufferSize
XoffByte Property
XonByte Property
XonXoff Property
Methods
CancelFileTransfer Method
ClearRQ Method
ClearTQ Method
Close Method
GetErrorStatus Method
Open Method
Read Method
ReadBinary Method
ReceiveFileXModem Method
ReceiveFileXModemCRC Method
ReceiveFileYModem Method
ReceiveFileZModem Method
SendFileXModem Method
SendFileXModem1k Method
SendFileYModem Method
SendFileZModem Method
SimulateReceivedXoff Method
SimulateReceivedXon Method
Write Method
WriteBinary Method
Events
OnBreakSignal Event
OnCdToggle Event
OnCtsToggle Event
OnDataReceived Event
OnDsrToggle Event
OnError Event
OnEventCharReceived Event
OnFileTransferComplete Event
OnFileTransferStatusUpdate Event
OnRing Event
OnTQEmpty Event

StopBits Property

Sets and returns the stop bits communications parameter.

Syntax

[Visual Basic]
object.StopBits [ = value ]

[C#]
object.StopBits [ = value ]

[C++]
object->StopBits [ = value ]

Parameters

object

An object expression that evaluates to a PortController object.

value

A value of type StopBitsValue indicating the stop bits setting.

Return Value

A value of type StopBitsValue representing the stop bits setting.

Remarks

  • StopBits values are contained in the SciCom.PortController.StopBitsValue namespace
  • Valid StopBits values are as follows:

    • StopBits_1 (Default)
    • StopBits_1_5 (1.5 stop bits)
    • StopBits_2

Default

StopBits_1

Errors

  • Attempting to set StopBits to an invalid value will cause the PortController to throw an "Invalid argument" exception.
  • Attempting to set StopBits to 1.5 when DataBits is 6, 7, or 8 is illegal and will cause PortController to throw a "Invalid stop bits / data bits combination" exception if the port is open. If the port is closed, no exception will be thrown.
  • Attempting to set StopBits to 2 when DataBits is 5 is illegal and will cause PortController to throw a "Invalid stop bits / data bits combination" exception.
  • Example

    [Visual Basic]
    'Set stop bits
    myPortController.StopBits = SciCom.PortController.StopBitsValue.StopBits_1
    
    'Get stop bits
    Dim stopBits as SciCom.PortController.StopBitsValue
    stopBits = myPortController.StopBits
    
    
    [C#]
    // Set stop bits
    myPortController.StopBits = SciCom.PortController.StopBitsValue.StopBits_1;
    
    // Get stop bits
    SciCom.PortController.StopBitsValue stopBits = myPortController.StopBits;
    
    [C++]
    // Set stop bits
    myPortController->StopBits = SciCom::PortController::StopBitsValue::StopBits_1;
    
    // Get stop bits
    SciCom::PortController::StopBitsValue stopBits = myPortController->StopBits;
    

    See Also

    DataBits property | BaudRate property | Parity property | Open method