12-07-2013 09:56 AM - edited 12-07-2013 10:05 AM
Hi can i want to know the execution order of functions in the bellow diagram . though all functions recieve data at the same time why functions executing from bottom to top when i see in highlight execution?
Solved! Go to Solution.
12-07-2013 10:45 AM
Execution Highlighting is a debugging option - and thus allows you to see the nodes execute in a sequential manner. That's a nice feature in LabVIEW.
Without Execution Highlighting, LabVIEW will do the best to execute that piece of code as fast as possible. You won't be interested in the execution order in this case, either.
With regard to your question
@kotresha wrote:
Hi can i want to know the execution order of functions in the bellow diagram . though all functions recieve data at the same time why functions executing from bottom to top when i see in highlight execution?
Best answer: Yes, you might want to know it. Actually no one cares
12-07-2013 12:33 PM
Thanks for your valuable answer. But is there any other way to confirm that all the functions execute at a time?
12-07-2013 12:36 PM
The answer to your question is that the Execution Order is "unknown", or "variable", or "unpredictable". If you impose another system on it (like whatever LabVIEW uses to "highlight execution"), another set of "unknown rules" may also come into play.
The principle of Data Flow says that examples such as yours execute in parallel to the best of the system's ability -- on a multicore multi-threaded CPU, they might actually execute in parallel on separate cores.
When teaching LabVIEW, I use an example where I create a parallel structure, and ask the students to predict the order of execution. I ran the identical code several times, and invariably the execution order of the parallel lines varied.
12-07-2013 01:07 PM
Thanks for your answer. It was helpful .
12-09-2013 08:32 AM
Just to elaborate on Bob's answer. Execution highlight forces the code into a single thread. This is not normal. LabVIEW does have some rules about which code may execute first when running single threaded (All subject to change when compiler optomizations are applied. So, take this all with a grain of salt since, it does not matter anyway.) Your example likely executes top to bottom because you built it that way, If you take the bottom function and move-to-back it may execute first. Z-Order Back-to-Front, seems to be a good guide to predict execution order with highlight execution on.
12-11-2013 12:08 PM
Thanks for your answer.It was more clear explanation for my question.
07-19-2015 11:49 AM
LabVIEW does have some rules about which code may execute first when running single threaded
One of those rules seem to be: Whatever you want to look at, runs LAST.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
07-21-2015 11:06 AM
@CoastalMaineBird wrote:
LabVIEW does have some rules about which code may execute first when running single threaded
One of those rules seem to be: Whatever you want to look at, runs LAST.
Select what you want to see execute Ctrl+Shift+J try it
Elsewise create a sub-vi of the "Interesting" portion and set it to suspend when called and Ctrl+arrow as desired
07-22-2015 12:34 PM
This looks like an exam question.