10-21-2008 01:56 PM
This is wierd. I noticed that the VI that performs serial communications with my power supply taking a long time (~15s). I turned on execution highlighting and the execution time reduced (~10s). I ran profiling with performance and memory and the total execution time is reported as only 250ms in normal mode but the front panel and block diagram are locked for 15s.
Any ideas on this behavior?
LV 8.5.1, WinXP
10-21-2008 02:00 PM
You most likely havew a timing problem in your code which is solved by running the execution highlighting on. You might just be avoiding a serial timeout or something similar by doing that.
Make sure your seuquential code is li nked by error clusters to make sure you're not accessing your port too early (Serial timeouts can be many seconds).
Shane.
10-21-2008 02:29 PM
10-21-2008 03:38 PM
That's a very different question to the first one.
The profiler counts the time spent executing the code WITHIN the VIs used. Time taken by certain system calls may not be reflected in the profiler time.
Are your questions regarding execution highlighting or using the profiler. They're two different things entirely.
Shane.
10-21-2008 03:51 PM
Shane--
Thanks for the replies.
I added an AE logging function that I use to help debug the code. When I added this, the timing came in line. I don't know what the root cause is but I think I will move on until it breaks again.
Thanks,
Kevin
10-21-2008 04:05 PM
kc64 wrote:Shane--
Thanks for the replies.
I added an AE logging function that I use to help debug the code. When I added this, the timing came in line. I don't know what the root cause is but I think I will move on until it breaks again.
Thanks,
Kevin
Does that mean you no longer have a problem? Did the problem go away? Or upon closer inspection you realize you really didn't have a problem? Or the AE logging function helped solve the problem for you?
"but I think I will move on until it breaks again". That is a troublesome thought. It you really have a problem but haven't solved it, that means it will eventually break, and when it does, you will have that much more code on top of it and make it that much harder to troubleshoot.
If you really have a problem, it's better to find it and fix it now while the code is still relatively simple. Building on a bad foundation is just going to cause the whole house to come crashing down later.
10-21-2008 04:11 PM
Yeah, I don't like the "just move on" part either. The AE somehow effected the timing of the power supply control code in a positive way so that it ran faster (at the expected speed). I don't understand why.
I fully agree with your assessment and would agree with the "troublesome" description but I have other code to debug too.
I'm sure I had a problem and it seems that I no longer do. I can't say just add an AE to solve your problems but it worked here because of some special case/boundary condition/weird interaction.