The checksum routine has been modified slightly to clarify the Select statement.
The "$" case is used to initialise Checksum and the If statement in the Else case has been removed. This works because Checksum = value gives the same result as Checksum = 0 Xor value when processing the first byte.
' Calculates the checksum for a sentence
Public Function GetChecksum(ByVal sentence As String) As String
' Loop through all chars to get a checksum
Dim Character As Char
Dim Checksum As Integer = 0
For Each Character In sentence
Select Case Character
Case "$"c
' Ignore the dollar sign
Checksum = 0
Case "*"c
' Stop processing before the asterisk
Exit For
Case Else
' XOR the checksum with this character's value
Checksum = Checksum Xor Convert.ToByte(Character)
End Select
Next
' Return the checksum formatted as a two-character hexadecimal
Return Checksum.ToString("X2")
End Function