haolan wrote:
Private Sub Command1_Click() Dim CheckSum As Byte, x, Tid MSComm1.Settings = "1200,N,8,1" Buffer = "GET" + vbCr CheckAndSum Buffer ' add Checksum and Length of string Buffer = Buffer + SumStr 'For x = 1 To Len(Buffer) ' Tid = Timer ' Do ' DoEvents ' Loop Until (Timer - Tid > 0.01) ' MSComm1.Output = Mid(Buffer, x, 1) 'Next x MSComm1.Output = Buffer End Sub
A few questions... Which serial port? How do you know this does not work? Where is code to listen for the result your program is expecting? What is the specification of the device that needs this input? Maybe the port parameters do not match up?