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

PortController Reference

PortController provides access to the following properties, methods, and events:

Property Description
AvailableSystemPorts Returns a collection of port names available to be opened.
BaudRate Sets and returns the baud rate communications parameter.
Break Sets and returns the state of the break signal.
BytesUsedRQ Returns a long integer indicating how many bytes are in the receive queue.
BytesUsedTQ Returns a long integer indicating how many bytes are in the transmit queue.
Cd Returns the state of the carrier detect line.
Cts Returns the state of the clear-to-send line.
DataBits Sets and returns the data bits communications parameter.
Dsr Returns the state of the data-set-ready line.
Dtr Sets and returns the state of the data-terminal-ready signal.
DtrDsr Enables/Disables and returns DTR/DSR hardware handshaking.
EnableReadOnEventChar Enables and disables reading from the receive buffer when the EventChar is received.
EventChar Sets and returns the character which, upon entry into the receive queue, will fire an EventCharReceived event.
ForceBeginInvokeEventFiring (Advanced) Forces the use of EventHandler.BeginInvoke when firing events. This allows the handling function to examine the sender object to determine which instance of PortController fired an event, but requires the handling function to use Invoke() when accessing UI properties or methods.
IsFileTransferInProgress Returns true if a file transfer is in progress.
IsOpen Returns the open state of the port.
Parity Sets and returns the parity communications parameter.
PortHandle Returns an IntPtr HANDLE to the open communications port.
PortName Returns the name of the port ("COM1", "COM2", etc.).
ReceiveBufferSize Sets and returns the recommended size of the port's internal input buffer, in bytes.
Ring Returns the state of the ring line.
Rts Sets and returns the state of the request-to-send signal.
RtsCts Enables/Disables and returns RTS/CTS hardware handshaking.
StopBits Sets and returns the stop bits communications parameter.
SystemPorts Returns a collection of the names of COM ports in the system.
TraceOutput (Advanced) Determines whether PortController emits trace information to the DefaultTraceListener.
TransmitBufferSize Sets and returns the recommended size of the port's internal output buffer, in bytes.
XoffByte Sets and returns the byte which serves as the XOFF software flow control signal.
XonByte Sets and returns the byte which serves as the XON software flow control signal.
XonXoff Enables/Disables and returns XON/XOFF hardware handshaking.
Method Description
CancelFileTransfer Cancels a file transfer.
ClearRQ Clears data from the receive queue.
ClearTQ Clears data from the transmit queue.
Close Closes the communications port.
GetErrorStatus Returns and clears the state of all incoming status lines.
Open Opens the communications port.
Read Reads data from the receive queue.
ReadBinary Reads binary data from the receive queue.
ReceiveFileXModem Receives a file using the XMODEM protocol.
ReceiveFileXModemCRC Receives a file using the XMODEM-CRC protocol.
ReceiveFileYModem Receives one or more files using the YMODEM protocol.
ReceiveFileZModem Receives one or more files using the ZMODEM protocol.
SendFileXModem Sends a file using the XMODEM protocol.
SendFileXModem1k Sends a file using the XMODEM-1K protocol.
SendFileYModem Sends a file or batch of files using the YMODEM protocol.
SendFileZModem Sends a file or batch of files using the ZMODEM protocol.
SimulateReceivedXoff Causes transmission to act as if an XOFF character has been received.
SimulateReceivedXon Causes transmission to act as if an XON character has been received.
Write Writes data to the output queue.
WriteBinary Writes binary data to the output queue.
Event Description
OnBreakSignal Fired when the Break signal is received.
OnCtsToggle Fired when the state of the Clear-to-Send line changes.
OnDsrToggle Fired when the state of the Data-set-Ready line changes.
OnCdToggle Fired when the state of the Carrier Detect line changes.
OnDataReceived Fired when a character is received and placed in the buffer.
OnError Fired when a line-status error occurs.
OnEventCharReceived Fired when the event character is received and placed in the input buffer.
OnFileTransferComplete Fired upon the completion of a successful, failed, or cancelled file transfer.
OnFileTransferStatusUpdate Fired periodically during a file transfer with information regarding the progress of the operation.
OnRing Fired when the state of the Ring line changes from high to low.
OnTQEmpty Fired when the last character in the output buffer is sent.