Hi,
First of all i am hardware background and all my software programming experience is in assembly language.
I am trying to send specific codes to a controller and read data back into a text box(just for starters, planning on decoding to user friendly format later). If the data matches 'abcd' then i print 'Passed' in text2. text1 is purely used for displaying any data received. I want to loop on data received until a CR is received (end of data)
*****************************************
CODE
Private Sub Form_Load()
End Sub
Private Sub Command1_Click()
'open comm
MSComm1.PortOpen = True
'send rs232 data ff <CR> 4C
MSComm1.Output = "ff" + Chr$(13)
'receive data until <CR> received
Do
dummy = DoEvents()
Loop Until MSComm1.Input <> Chr$(13)
'print value in text box
Text1.Text = MSComm1.Input
'close port
MSComm1.PortOpen = False
End Sub
Private Sub Text1_Change()
Text1.Text = MSComm1.Input
End Sub
Private Sub Text2_Change()
If Text1.Text = "abcd" Then Text2.Text = "Passed"
End Sub
******************************************
Mode Edit - Please remember to paste your code in the code tags.