I have a custom arcpad applet that will read data sent over the serial port. The code to read from the serial port I inherited and has worked flawlessly till now. A new bluetooth instrument has replaced the old cabled system. All of the serial port settings are the same, but the code will only read selective pieces of data. I have a simple text word "start" to read first, and then a few seconds later the following string is read. DATA$,#,#,#,....,# 167. I can read the start string but I don't ever get the DATA string is never read! My feeling is the code is still working fine but the timing is off.
I need help quickly and any help would be greatly appreciated.
'From APA File
OnComm=Call Trigger
-------------------------------------------------------------------------------
Set Timer1 = Application.Timer
' Subroutines control communication with Microcontroller
Private Sub Timer 'Starts Timer to Wait for Input
Call ParseInput
End Sub
Sub Trigger 'Trigger for Timer when receiving data for Microcontroller
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
Sub ParseInput 'OnTimer Event Subroutines reads COM port and dumps everything to a string
Dim test
Do While Aux.InBufferCount > 0
test = Aux.Read(Aux.InBufferCount, False)
msg = msg & test
Loop
Timer1.Enabled = False
If msg="Microcontroller" Then
MsgBox msg & " successfully communicated with ArcPad", vbInformation, "Communication is Ok" 'Communication Check Acknowledgement
msg = ""
Else
'MsgBox msg, vbInformation, "Communication is Ok" 'Communication Check Acknowledgement
Call Decision
End If
End Sub