I’m trying to figure out why my display loop slows down after about 10 minutes and continues to slow down until the collection is completed after an hour or two.
I wrote the code about 5 years ago using LV 2009. Now I’m using LV 2010. I’m still using the same XP computer and the same PXI hardware.
The Target collects the data and writes it to files on the Target. After collection the files are transferred via TCP/IP to the Host. During collection the current file sizes are displayed on the Host. This data is transferred between the Target and Host via TCP/IP using a different port from the file transfer ports. The loop on the Target writes to the port and the loop on the Host reads from the port.
If the display is not updated regularly and promptly, past experience has shown that the data is not being written to the file fast enough and therefore is lost. That is not true now. Data is being written at adequate speed. The GV that contains the file sizes is also written to at adequate speed. However, the loop on the Target is not reading the GV adequately and slows down over time. This has a direct correlation to the loop speed on the Host and the Target. Enclosed is a snippet of the loop on the Target since it has direct impact on the loop on the Host.
I’m running into TCP/IP errors when I try removing portions of the loop. I know there are debug tools that could help but I’m not very familiar with them. This is a mystery since 5 years ago the code worked and nothing has changed.
Suggestions for tools to help diagnosis the problem?
The snippet shows how the data gets transfered from Target to Host. The display actually occurs on the Host. Since the Host display update rate (reading TCP/IP) is the same the Target sending rate (writing TCP/IP) I only included the contents of the TCP/IP loop on the Target side. I assume if I fix the Target side, the Host side will be resolved.
... and the TCP update rate depends how frequent the subVI is called, completing the circular conclusion.
How often is this subVI called? Why are there coecion dots?
How big are the data strings? Are they always the same size? How are you reading the data? (e.g. fixed size?)
How fast is your network? What else is going on. What kind of network utilization do you see in the control panel.
Why would you say nothing has changed? If nothing else, the version of LV (which means every VI has been updated) and whatever changes you made to update quicker to avoid data loss have changed. It's not helpful to give us things that are blatantly false.
You're showing us a piece of the code hoping the fix is in that small portion. It may be. It may not. We could just as reasonably suggest cleaning up the host side will speed it up and therefore have it respond to the target quicker and speed the code up.
I'd be more interested in seeing what the memory and PC usage looks like on both the host and target after 10 min of running. How are you storing the data on both sides? Is it done so in a way that might start to eat these resources and slow either device down?
In debugging, using the Disable structure, I've eliminated everything in the loop except sending a constant, 192 byte string. The loop runs every 2-3 seconds initially but slows down to up to 15 seconds after 10 minutes.
My PXI is directly connected to my PC via Ethernet, physically isolated from anything else so there is nothing else on the network.
Over time my CPU usage drops from 20-35% to 8-15%. The Network Utilization drops from 0.09-0.13% to 0.02-0.05%. The network speed is 1 Gbps. But after 10 minutes the loop rate slows to 20 seconds. This is from Windows Task Manager.
What tools are available on the PXI side?