12-22-2005 12:38 PM
Working around debugger losing track of vi operations, I found out the TCP stream was corrupted. But no error is reported by the first Read TCP.vi used to get the incoming message length. As a result, the second read eventually gets a parameter to read a message of randomly selected length.
The TCP stream is guaranteed to be ordered and complete. The TCP data source is feeding without a problem several other clients for chart display purposes.
Although no errors were flagged by TCP Read.vi, I expected a possible overrun of the TCP-IP stack input buffer. The calling vi loop would need more CPU time to transfer TCP messages to the RT-FIFO. I raised this vi priority to high. As a result: no more TCP stream data corruption. Frame size is always 5126.
Application is running fine since 20 hours now.
Issue solved. Unfortunately, I can't observe CPU load margins. I feel the execution trace toolkit is not easy to use with a desktop PC target. (lots of CPU operations)
If my observations are exact...here are some resulting suggestions:
1-Is it possible to check and possibly improve TCP library error messages on the pharlap based labview RT to not miss overrun errors?
2-It could be worth looking for reasons where the RT thread seems to stop and the debugger loses track if read tcp.vi is called in a subroutine with an improper data size?
3-I also changed the TCP read mode to buffered. IMHO, It is important to do so to avoid loosing track of the stream in case of timeout. Reading an incomplete packet would provide incomplete data and loose position of the next data packet length message.
Thank you for your help.
12-27-2005 04:37 PM
Hi bobp,
It looks like you've invesitaged this quite a bit. However, I still have a few questions for you:
1. What do you mean by the "debugger losing track of vi operations"? Are you referring to the execution trace toolkit?
2. How is the TCP stream getting corrupted? Is it missing data?
3. You say that the first TCP Read does not return an error -- does it return anything? I'm assuming it has some data, since the second read depends on that when reading the data stream (I'm assuming you're using the TCP Msg Read.vi from the example you cited)
4. TCP is a handshaked protocol, so nothing should be overwritten. How is your TCP stream getting corrupted? Is it missing data? What makes you suspect an overrun of the TCP-IP stack in Pharlap?
Thanks in advance,
01-03-2006 08:51 AM
01-03-2006 03:04 PM
Hi bobp,
I agree with your feeling that TCP/IP is "not optimal" on Pharlap
I guess you already set the inteface to Half Duplex, if its not connected through a HUB or eqv., as recomended somewere at ni.com (I cant remember the exact place, but I've seen it in at least two places, one as a performance recommendation
I have experienced the problem with MAX and Full Duplex...
I suspect that the TCP/IP stack is not coded when todays modern harware was availible, and therfore has som bug / deadlock, that becomes critical when connecting point to point with full duplex.
01-06-2006 11:58 AM
Hi bobp,
Thanks for the additional info. It sounds to me as though one of your loops is starving out the other (as you've already alluded to). Since the execution highlighting makes it appear as though one loop is always executing while the other is not, it is clear that it is taking priority and starving the other. You have appropriately remedied this by increasing the priority of the affected loop.
The fact that the first read does not report an error, yet returns erroneous data is troubling to me. I cannot immediately comment on what could be causing this other than a possible error in the way Pharlap handles that TCP stack. I can, however, ping our R&D team for more information.
Thanks,