I also don't see anything directly that would cause the code to slow down over time. There are a couple things I might recommend, but I'm hesitant because the code looks so meticulously and exquisitely written!
🙂There are a few places in your application where you use a local variable when a direct wire connection is possible. Direct wire connections are always preferable if possibe. Granted, this would only make a small difference in memory usage and performance and should NOT cause your code to slow down. For instance, in the second loop you write a value to PDA Lifter and then read the PDA Lifter value from a local variable. A direct wire connection here would be preferable. Also, in the third loop you are writing all your values to the LEDs (TestLED, HighLED, etc) using local variables. You could easily perform your logic inside the case structure that decides what values to send to the indicators, but then actually use direct terminal connections for the LEDs outside the case structure instead of using local variables.
Finally, if you are using the LabVIEW 8.0 or 8.0.1 PDA module, you might consider transitioning the second loop into an event structure that would only run if a user clicks on one of the buttons. That would save one of the loops from constantly polling six buttons and checking to see if a new value was registered. PDA applications are multi-tasked, not multi-threaded, so it would help to have less loops running concurrently.
I also agree with trying to put all the TCP communication in one loop. It obviously wouldn't make sense to have a TCP Write in the same loop as a TCP Read set to have infinite timeout, since that would slow down the write process if the 2 bytes weren't available at the port to read, but you could set a timeout of 0 or 100ms and then probe the error output to see if a timeout occured.
I've been trying to reproduce the slowdown on my computer with your code. I closed the loop by setting the target IP to localhost and setting the server and client loops to both use port 5555. This sets the app to just talk to itself. It's running fine with no errors, and so far on the PocketPC emulator I see no slowdown. This might be strictly related to TPC-2006 devices.
Jarrod S.
National Instruments