VB Serial Data Acquisition with MSComm

Using the MSComm control

Private Sub MSComm_OnComm()

'The OnComm event program for MSComm?

'Write the respective program code depending on the value of the CommEvent property?

'Depending on the value of the CommEvent attribute, the respective program code is written into the relevant subroutine

'In this case, as soon as the number of characters set in the attribute RThresold has been reached

'the value of the CommEvent attribute is changed to comEvReceive

'so that the receiving subroutine will be executed

'''''''''''''' ''''''''''''''''''''''''

Select Case MSComm.CommEvent

Case comEvReceive ' Receive RThreshold # of

BB = MSComm.Input

For jj = 0 To UBound(BB)

Call bbPrintVVV(BB(jj))

txtReceive = Str(BB(jj)) & txtReceive

Next jj

DDi = DDi + 1

' tt = StrConv(MSComm.Input, vbUnicode) 'Returns Variant (String) converted to the specified type.

' DD = AscW(tt) 'The (16-bit encoding scheme) character code for the first character , 0 - 255

' txtReceive = txtReceive & " " & tt & "(" & DD & ")"

' Case comEvSend ' Transmit buffer has Sthreshold characters

' Case comEvCD ' The state of the CD line has changed

'

' Case comEvCTS ' The state of the CTS line has changed

'

' Case comEvDSR ' The state of the DSR line has changed

'

' Case comEvRing ' Ring Indicator changes

'

End Select

End Sub