You are building arrays inside the loop. As they grow LV needs to continually reallocate memory. Arrays require contiguous memory blocks. When the arrays get too large, the OS may start swapping to disk and then things really slow down.
After you write the data to the file, clear the arrays.
Better is to preallocate space for the arrays and use Replace Array Subset inside the loop.
You are building three complicated arrays with no upper size limit and you will run out of memory. Every time the array grows, memory needs to be reallocated. These near infinite sized arrays are the graphed, also not a fast process.
Most likely your noticing a slowdown once the OS starts swapping.
Why don't you use a charts with limited histories and stream the data to disk for later retrieval?
Thanks that definately makes sense. I'm still learning my way around labview and don't really know how to do this. How do I limit the size of an array ? How do I limit the history size in a chart so that I don't end up in a swapping situation ? Are there any examples of something like this around ?
How do I limit the history size in a chart so that I don't end up in a swapping situation ?
A chart has a built-in history buffer. The default size is 1024 samples but you can configure it with a "right-click... chart history lenght"
Ok so I've got a chart now and it isn't chewing up a ridiculous ammount of memory !!
THe problem I am having now is that the initial time on the charts is 19:00:00 2003/12/31. How do I initialize the chart time so that it is the current time and not new years eve in 2003 ??
That is actually December 31, 1903 at 6 pm. You must be in the central time zone.
You need to take the current time before your while loop starts and wire it to the XScale.Offset property node for each of your charts. Also set the XScale.Multiplier to be the value you have in the control going into the time delay function.