CommEvent
Retrieves a numerical event code indicating the most recent event or error.
MSComm32 and SComm32 have the same syntax and SIMILAR functionality (SComm32 is improved. See below)
|
|
|
value:- |
A numeric value being one of the following.
|
1 |
comEvSend
There are < SThreshold number of bytes remaining in the transmit buffer |
2 |
comEvReceive
There are >= RThreshold number of bytes in the receive buffer |
3 |
comEvCTS
The state of the CTS input changed. |
4 |
comEvDSR
The state of the DSR input changed. |
5 |
comEvCD
The state of the Carrier Detect input changed. |
6 |
comEvRing
Ring Indicate |
7 |
comEvEOF
End of File character was read. |
|
|
1001 |
comEventBreak
A break signal was received/detected. |
1004 |
comEventFrame
The hardware/Driver detected a framing error |
1006 |
comEventOverrun
The hardware could not receive data fast enough and some was lost. |
1008 |
comEventRxOver
Receive Buffer Overflow. There was no room in the receive buffer and some data was lost. |
1009 |
comeventRxParity
Parity Error. |
1010 |
comeventTxFull
Application tried to queue a character into the transmit buffer while the buffer was full. |
1011 |
comEventDCB
An error occured while setting up the Windows Com Driver. |
Example:-
Private Sub SComm1_OnComm
Select Case SComm1.CommEvent
Case 2 '// evReceive
Text1.Text = Text1.Text & SComm1.Input
Case 1001 to 1011 '// An Error
Text2.Text = "A Comm Error Occured"
Case Else
'// Something else happened.
'// Lets ignore it.
End Select
End Sub
|
|