Hi there,
I trying to receive/collect data and parse from my microcontroller, but for some reason I got data received with random breaks and I can't parse them while receiving.
Code:
Private Sub comRS232_OnComm()
Dim vrBuffer As String
Dim lgFwV As Long
Dim lgFwDate As Long
Dim lgFwTime As Long
comRS232.InputLen = 0
vrBuffer = ""
vrBuffer = comRS232.Input
lgFwV = InStr(vrBuffer, "FWVER=")
lgFwDate = InStr(vrBuffer, "DATE=")
lgFwTime = InStr(vrBuffer, "TIME=")
If lgFwV > 0 Then
lblFwVer.Caption = Mid$(vrBuffer, lgFwV + 6, 3)
End If
If lgFwDate > 0 Then
lblFwDate.Caption = Mid$(vrBuffer, lgFwDate + 5, 11)
End If
If lgFwTime > 0 Then
lblFwTime.Caption = Mid$(vrBuffer, lgFwTime + 5, 8)
End If
Debug.Print vrBuffer
txtSerial.Text = txtSerial.Text + vrBuffer
txtSerial.SelStart = Len(txtSerial.Text)
Exit Sub
End Sub
I got these differend Debug output receiving from two idetical microcontroller board, but with different serial chip:
Board 1:
Code:
RDW Rem
ote Cont
rol
FWV
ER=1.2
DATE
=Sep
18
2018
T
IME=
13:3
4:23
Board 2:
Code:
RDW Remote Control
FWVER=1.2
D
ATE=Sep 18 2018
TIME=13:34:23
The board sketch is very simple one:
Code:
void setup()
{
Serial.begin(9600);
while (!Serial)
{
delay(10);
}
delay(500);
Serial.print(F("RDW Remote Control"));
Serial.println(F(""));
Serial.println(F("FWVER=1.2"));
Serial.println(F("DATE=Sep 18 2018"));
Serial.println(F("TIME=13:34:23"));
Serial.println(F(""));
}
They are using all the same serial connection settings:
I already posted my issue on the official board forum, but they say it's not board relevant and it's must be in my VB6 code.
Can someone tell me what I'm doing wrong?
Thank you!