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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Breakpoint happens in the wrong place

Ok this is a strange one. Refering to the snippet:

 

 

Breakpoint in the wrong place.png

 

When I run this code, the breakpoint fires and the TCP Modbus VI is highlighted as the next node to execute, which is ok I guess though I could make a case for another behavior. The problem is that when I click the continue button with highlighting turned on the next function to execute is the 1D Array Sort! After it runs, execution continues with the small loop, my little "blocks" VI and finally the loop to the right. When execution finally reaches the breakpoint's actgual location, it does not fire again.

 

HOWEVER, if I change this code to turn on parallelism in the little loop after the sort, all works as I would expect: The breakpoint fires and the next things to execute is the loop to the right.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 1 of 4
(3,028 Views)

I have seen cases before where LV does get the order incorrectly. See here for an example - http://forums.ni.com/t5/LabVIEW/Should-a-shift-register-output-data-prior-to-loop-execution/m-p/3241...

 

I also remember bugs where it looks like LV tries to optimize the order of operations in parallel code and ends up running something which is supposed to be after a loop before it, although I can't find it with a quick search.


___________________
Try to take over the world!
0 Kudos
Message 2 of 4
(3,010 Views)

What happens if you put probes on the wires between the 1D Array Sort and the breakpoint?

 

I try not to trust debugging tools too much because little things like that seem to happen.  The complier optimiazations and the debug code sometimes seem to fight each other.

 

Lynn

0 Kudos
Message 3 of 4
(2,984 Views)
They don't update until after the breakpoint fires and I resume execution.

By the way, I don't really have any expectations that NI will ever fix this... But going forward people should know about it and perhaps this conversation will help them.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 4
(2,979 Views)