12-15-2015 11:03 AM
I am putting together a VI to read TCP data that has a 12 byte TCP wrap (the first 12 bytes of every TCP packet of data) but I am having problems when TCP data does not exist.
Is there a way to determine if TCP data exists for a specific device (IP address) before I attempt to read the
TCP wrap that is used for each TCP packet?
thanks
Solved! Go to Solution.
12-15-2015 11:06 AM
No not really - set a suitable timeout value and ignore the timeout error (code 56) if no data comes in.
12-15-2015 11:12 AM
Thanks for the reply.
How do I ignore the time out error?
12-15-2015 11:17 AM
Consult the excellent error handling chart I have attached!
12-15-2015 03:18 PM
I have found what is causing the error.....
There sems to be a couple different variants of one field of TCP data that can either be 32 or 34 bytes of data
where if I do not read the correct number of bytes I end up with a framing error in my decoding...
This first byte where I am reading 1 byte in the picture below contains the number of bytes that needs to be read.
I would like to accomodate for reading the correct number of bytes and have tried unsuccessfully with the following:
Any suggestions on how best to do this?
thanks again
12-15-2015 03:29 PM - edited 12-15-2015 03:33 PM
I'm pretty sure you want to stick an array index in there as the U8 out is a numeric array and you want the Zero index.
12-15-2015 03:35 PM
What is the format the byte you read for the length? Type Cast to a numeric may be what you need.
Lynn
12-16-2015 08:56 AM
Thanks for the replies...
My bad, I meant to type cast instead of the array to u8 ...
12-16-2015 09:29 AM
Maybe I spoke too soon...
The value that seems to change is the first byte of the TCP data which contains the size of the TCP data in bytes.
In what I am seeing, this first byte is 20h (0x20) when looking at the TCP data in wireshark, and when my front panel
displays this value as the indicator "String" (with hexidecimal display style), it is shown as "18" and in probe watch [4} "|"
What I am trying to do is read this first byte, and then use it to read the remainder of bytes in that TCP packet but I obviously don't know what I am doing or how to do that.
Any help with this is greatly appreciated.
Thanks
12-16-2015 10:01 AM
0x20 is 0d32 - which is the number of bytes in your packet. If you type cast your 1-byte length string to a U8, you should get the packet size.