Sub Parser_EndElement (Uri As String, Name As String, Text As StringBuilder)
If parser.Parents.IndexOf("probe") > -1 Then
If Name = "name" Then
ProbeName = Text.ToString
Else If ProbeName = "Amp_3" And Name = "value" Then
ProbeResult = Text.ToString
End If
End If
Log(ProbeName & " : " &(ProbeResult))
End Sub
You pass "Name" and check for it with the "If", but how to you expect it to get to the "Else If"
So if "Name" is "name", "ProbeName" becomes "Text.ToString". Then the "If" ends. Then you log both "ProbeName" and "ProbeResult", but nothing has been really assigned to "ProbeResult" at all in this function, so it prints whatever ProbeResult has been set to before it enters this function.
Global variables really confuse this function. If you would DIM ProbeResult in this function instead of outside the function, you would notice that this function does not set it (or at least in a way that you expect).