Returns the most recent communication event or error. This property is not available at design time and is read-only at run time.
object.CommEvent
The parts of the CommEvent property syntax are described in the following table.
Part | Description |
---|---|
object | An object expression that evaluates to an object. |
Although the OnComm event is generated whenever a communication error or event occurs, the CommEvent property holds the numeric code for that error or event. To determine the actual error or event that caused the OnComm event, you must reference the CommEvent property.
The CommEvent property returns one of the values found in the following tables for communication errors or events.
ComEvent Property Error Values
Error Value | Description |
---|---|
1001 | A Break signal was received. |
1002 | Clear To Send Timeout. The Clear To Send line was low for the system specified amount of time while trying to transmit a character. |
1003 | Data Set Ready Timeout. The Data Set Ready line was low for the system specified amount of time while trying to transmit a character. |
1004 | Framing Error. The hardware detected a framing error. |
1006 | Port Overrun. A character was not read from the hardware before the next character arrived and was lost. |
1007 | Carrier Detect Timeout. The Carrier Detect line was low for the system specified amount of time while trying to transmit a character. Carrier Detect is also known as the Receive Line Signal Detect (RLSD). |
1008 | Receive Buffer Overflow. There is no room in the receive buffer. |
1009 | Parity Error. The hardware detected a parity error. |
1010 | Transmit Buffer Full. The transmit buffer was full while trying to queue a character. |
1011 | Unexpected error retrieving Device Control Block (DCB) for the port. |
ComEvent Property Event Values
Value | Description |
---|---|
1 | There are fewer than Sthreshold number of characters in the transmit buffer. |
2 | Received Rthreshold number of characters. This event is generated continuously until you use the Input property to remove the data from the receive buffer. |
3 | Change in Clear To Send line. |
4 | Change in Data Set Ready line. This event is only fired when DSR changes from 1 to 0. |
5 | Change in Carrier Detect line. |
6 | Ring detected. Some UARTs (universal asynchronous receiver-transmitters) may not support this event. |
7 | End Of File (ASCII character 26) character received. |