LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Execution faster with execution highlighting???

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

0 Kudos
Message 1 of 7
(2,643 Views)

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.

0 Kudos
Message 2 of 7
(2,642 Views)
All VIs in my test program are linked sequentially by error cluster.  Any ideas why the profiler would indicate 250ms execution while the windows are locked for 15s?
0 Kudos
Message 3 of 7
(2,625 Views)

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.

Message 4 of 7
(2,614 Views)

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

0 Kudos
Message 5 of 7
(2,605 Views)

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". Smiley Surprised 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.

0 Kudos
Message 6 of 7
(2,597 Views)

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.

0 Kudos
Message 7 of 7
(2,591 Views)