
Chapter 2 Program Flow
2-11
PDQComm1.PortOpen = True
End Sub
'
' Closes the communication port.
'
'
Private Sub CommClose()
'----------------------------------------
' Closes a port.
'----------------------------------------
PDQComm1.PortOpen = False
End Sub
'
' Encloses the character string designated to the communication port
' in double Quotations. The system then adds a carriage return to
' the end of the line and sends this.
' SendText$: character string to send
'
Private Sub CommWrite(SendText$)
'----------------------------------------
' When character string and control code ich (CR+LF) are sent.
'----------------------------------------
PDQComm1.Output = Chr(&H22) &SendText$ & Chr(&H22) & Chr(13)
& Chr(10)
'----------------------------------------
' Waits until the output buffer becomes vacant.
'----------------------------------------
Do
DoEvents
Loop Until PDQComm1.OutBufferCount = 0
End Sub
'
' Obtains the character string received from the communication port
' until the carriage return appears, and then returns the character
' string.
'
Private Function CommRead()
'----------------------------------------
' Data reading process
'----------------------------------------
InString$ =““
Do While 1
DoEvents
Continued on the following page.
Komentarze do niniejszej Instrukcji