From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
02-12-2014 02:54 PM
I have a for loop in a sub-VI whose execution time increases with each call of the sub-VI. Has anyone experienced this sort of behavior? The loop's primary function is to collect data from an XML file. I found that many of the built in XML functions execute rather slowly, and have minimized their use, but the loop still takes longer and longer to execute.
Thanks in advance for any help you may be able to provide,
David
02-12-2014 02:59 PM
Without seeing any code, I would have to say the data file is growing bigger with each passing moment and therefore takes longer to read.
02-12-2014 03:01 PM
Sorry, because of the type of work I do, I'm hesitant to provide segments of code. The Files are fixed size, I'm opening them as read only, and have the code designed so that they are opened only on the first execution of the sub-VI.
So thanks for the suggestion, but I've already got that one covered.
David
02-12-2014 03:59 PM
Sounds like an uninitialized shift register that grows with each call thus processing more and more data.
/Y
02-13-2014 05:35 AM
Again, thanks for the suggestion, but I've removed all the shift registers from the for loop. The loop has one indexing tunnel and 6 other tunnels (including an error cluster) coming in, and three indexing tunnels going out. It also contains a while loop and a few case structures inside the loop.
For the information of anyone else that views this thread, I'm a seasoned LabVIEW developer. Although I let it expire I once held a CLAD certification, and just missed the required score for CLD certification. I believe I've examined all the obvious stuff regarding timing of this loop, but can't see what's causing the gradual increase in execution time of subsequent calls. I've even gone so far as to place diagram disable structures around various parts of the code within the loop in an attempt to isolate the cause to a certain part. It seems that all the parts of the code within the loop are contributing to the problem. I have also opened a service request ticket with NI regarding this issue.
Thanks again for the suggestion,
David
02-13-2014 07:12 AM
Ok folks, I have it figured out. It turns out that there are a LOT of references opened when you do wtuff with XML files. If you neglect to close them ALL, it may cause the timing of yout code to slowly increase.
I went through my code, and systematically close every reference that I'm done using, and VIOLA! the loop is consistentaly at 131 ± milliseconds.
Thanks for the suggestions, and let's mark this one closed.
David
02-13-2014 07:15 AM
OOPS sorry about all the typos. In my excitement of having solved this I forgot to run the spell checker. :-0
David