Here is some code which worked fine under 6.3 and falls over under 6.5. It uses serial2. Has anybody else had this problem?
I trimmed it to a minimum. Under 6.3 it reads the GPS on the serial line at good speed and smoothly. Under 6.5 it does it in fits and starts.
The full programme compiled under 6.5 just gets the error in GPSGetChar, as listed below. Under 6.3 it works fine. (This is on the PDA, an HP iPaq 212a. On the PC it runs without any trouble at all. This is still true after a hard reset on the PDA.)
Any ideas please?
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Sub GPSGetChar 'Returns the next character from the GPS, or chr(0) if none available
ErrorLabel(ErrorGetChar)
ok = False
Do While ok = False
If GPSBufferPointer >= GPSBufferLength Then
i = GPSGetBuffer
If i <= 0 Then Return Chr(0)
End If
i = Chr(GPS(GPSBufferPointer))
GPSBufferPointer = GPSBufferPointer + 1
If i <> Chr(0) Then ok = True ' Ignore nulls
Loop
Return i
ErrorGetChar:
Msgbox("Error in GPSGetChar") 'This is where it dies in 6.5 -
' not on the cut down version of the programme, but on the full one which
' is rather too big to put up on this forum!
Serial2.PortOpen = False
AppClose
End Sub
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Sub GPSGetBuffer 'Gets a new bufferful from the GPS ' Returns the character
' count in the buffer (0 if none available)
GPSBufferPointer = 0
GPSBufferLength = 0
ErrorLabel(GetBufErr)
i = Serial2.InBufferCount
If i > 0 Then
GPS() = Serial2.InputArray
GPSBufferLength = ArrayLen(GPS())
'Not always the same as i !
End If
Return GPSBufferLength
GetBufErr:
If Charting = False Then
Msgbox("You have become disconnected from the GPS")
Serial2.PortOpen = False
AppClose
Return 0
End If
End Sub
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Sub GPSFlushBuffer
n = 100 ' Just in case!
i = 1000
Do While (i >= 100) AND (n > 0)
i = GPSGetBuffer
n = n - 1
Loop
GPSLinePointer = 0
End Sub
- - - - - - - - - - - - - - - - - - - - - - - - - - -
I will be interested in your ideas. It has taken me a couple of days to sort out that this seems to be a 6.5 bug - including the hard reset of the PDA unfortunately!
Chester Wilson.
I trimmed it to a minimum. Under 6.3 it reads the GPS on the serial line at good speed and smoothly. Under 6.5 it does it in fits and starts.
The full programme compiled under 6.5 just gets the error in GPSGetChar, as listed below. Under 6.3 it works fine. (This is on the PDA, an HP iPaq 212a. On the PC it runs without any trouble at all. This is still true after a hard reset on the PDA.)
Any ideas please?
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Sub GPSGetChar 'Returns the next character from the GPS, or chr(0) if none available
ErrorLabel(ErrorGetChar)
ok = False
Do While ok = False
If GPSBufferPointer >= GPSBufferLength Then
i = GPSGetBuffer
If i <= 0 Then Return Chr(0)
End If
i = Chr(GPS(GPSBufferPointer))
GPSBufferPointer = GPSBufferPointer + 1
If i <> Chr(0) Then ok = True ' Ignore nulls
Loop
Return i
ErrorGetChar:
Msgbox("Error in GPSGetChar") 'This is where it dies in 6.5 -
' not on the cut down version of the programme, but on the full one which
' is rather too big to put up on this forum!
Serial2.PortOpen = False
AppClose
End Sub
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Sub GPSGetBuffer 'Gets a new bufferful from the GPS ' Returns the character
' count in the buffer (0 if none available)
GPSBufferPointer = 0
GPSBufferLength = 0
ErrorLabel(GetBufErr)
i = Serial2.InBufferCount
If i > 0 Then
GPS() = Serial2.InputArray
GPSBufferLength = ArrayLen(GPS())
'Not always the same as i !
End If
Return GPSBufferLength
GetBufErr:
If Charting = False Then
Msgbox("You have become disconnected from the GPS")
Serial2.PortOpen = False
AppClose
Return 0
End If
End Sub
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Sub GPSFlushBuffer
n = 100 ' Just in case!
i = 1000
Do While (i >= 100) AND (n > 0)
i = GPSGetBuffer
n = n - 1
Loop
GPSLinePointer = 0
End Sub
- - - - - - - - - - - - - - - - - - - - - - - - - - -
I will be interested in your ideas. It has taken me a couple of days to sort out that this seems to be a 6.5 bug - including the hard reset of the PDA unfortunately!
Chester Wilson.