Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

ACK or NACK Message inside of vb

Posted on 2012-09-20
7
Medium Priority
?
442 Views
Last Modified: 2012-10-03
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
0
Comment
Question by:cmdolcet
  • 4
  • 3
7 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38421001
>I palce the ACK or NACK inside slot (0)

How do you place it?
0
 

Author Comment

by:cmdolcet
ID: 38421436
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
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 1600 total points
ID: 38421648
That depends on what ACK and NACK is represented by in the device that you are using.

Note that if you are talking about general ACK and NACK signals, these are handled by ports and not sent to your program. You will only receive actual data.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:cmdolcet
ID: 38422291
But how can I compare if what I got in the serial buffer is an ACK or NACK
0
 

Assisted Solution

by:cmdolcet
cmdolcet earned 0 total points
ID: 38430134
OK, I solved my problem all I did was compare it like this:

If TemparrayLenght = 2 and temparray(0) =chr(6) then

end if

The chr (6) which is the ASCII representation seems to work.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38432873
so chr(21) for NAK?
0
 

Author Closing Comment

by:cmdolcet
ID: 38457995
I was able to take CodeCruiser  general comment and apply it my my specific needs
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Screencast - Getting to Know the Pipeline

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question