Link to home
Start Free TrialLog in
Avatar of cmdolcet
cmdolcetFlag for United States of America

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
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

>I palce the ACK or NACK inside slot (0)

How do you place it?
Avatar of cmdolcet

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
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
But how can I compare if what I got in the serial buffer is an ACK or NACK
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
so chr(21) for NAK?
I was able to take CodeCruiser  general comment and apply it my my specific needs