cmdolcet
asked on
ACK or NACK Message inside of vb
How can I catch the ACK or NACK in my serial COM using the following code. Once I parse the incoming message I palce the ACK or NACK inside slot (0) I then want to compare to see whether it was ACK or NACK. I put in an if statement to look for whats inside the Array slot (0) however how can I compare it to the ACK or NACK value.
strData = strData.Replace(vbCrLf, vbTab).Replace(Chr(26), "").Replace(Chr(12), "").Replace(Chr(13), "")
'Parses out the information gathered from the COM port to a temp array
tempArray = Split(strData, ",")
If tempArray(0) = Then
End If
strData = strData.Replace(vbCrLf, vbTab).Replace(Chr(26), "").Replace(Chr(12), "").Replace(Chr(13), "")
'Parses out the information gathered from the COM port to a temp array
tempArray = Split(strData, ",")
If tempArray(0) = Then
End If
ASKER
What I mean by that is that the message received from the COM port (Which is a non printable value) is placed in the TempArray(0) slot.
The problem is how can I compare the TempArray value in slot (0) to whether it actually ACK or NACK
The problem is how can I compare the TempArray value in slot (0) to whether it actually ACK or NACK
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
But how can I compare if what I got in the serial buffer is an ACK or NACK
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
so chr(21) for NAK?
ASKER
I was able to take CodeCruiser general comment and apply it my my specific needs
How do you place it?