LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview debugger trace execution accuracy

Solved!
Go to solution

Hi All,

 

I was debugging a program using the execution trace (watch the bubbles ...), and noticed that everything executed in a serial fashion. If there are two areas of a vi that are completely independent of each other, I have thought that Labview would recognize this and run these in separate threads. So, does the Labview compiler actually create these multiple threads for independent clusters of code? In that case, the execution trace does not show this multi-threading ... is that all true?

 

I am hoping to modify code previously written, and have run into a few cases where I need to know exactly how the code is being executed.

 

Thanks for your help!

-Mike

0 Kudos
Message 1 of 3
(2,618 Views)
Solution
Accepted by topic author mjs454

Execution trace is debugging tool (mainly to check that the right values are going to right places), unless the code is serial then it's unlikely that execution trace will do things in the same order as normal. LabVIEW can certainly run independent pieces of code simultaneously (it doesn't create threads for the independent code it has various pools of threads that that cluster of code can get assigned to when running), but with the trace on it runs in serial to make monitoring what's going on easier.

 

When the order of operations isn't enforced (through stuff like dataflow, synchronization primitives and action engines), then different executions of the VI may have different orders. If the order matters, then you must enforce it (preferable it's written so you need a minimal amount of enforcement), otherwise you get errors from race conditions (which can be extremely intermittent and hard to find). Which is way stuff like local variables are frowned upon since they break data flow and make enforcing order harder on top of being slower than wires. I'm guessing your need to know exactly how the code is being executed might be from order not being enforced when it should.

Message 2 of 3
(2,601 Views)

Thanks, that's what I was looking for. I agree that it's always best to explicitly code these cases... didn't know if there was something I was missing.

-Mike

0 Kudos
Message 3 of 3
(2,590 Views)