LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

conditonal breakpoints

what's meaning of Pass Count in Conditional Breakpoints? how to use it?
 
0 Kudos
Message 1 of 7
(3,902 Views)

Hello Taxi,

The source code line will be executed a certain amount of times (equal to Pass Count) before the breakpoint is set.

An Example:

-----------------------------------------------------------------

for (counter = 0; counter < 50; counter++)

     Delay (0.1);

-----------------------------------------------------------------

Suppose you place a breakpoint on the line of Delay(0.1), with Pass Count set to 20. The debugger will go to the loop 20 times. The 21th time the debugger will break on this line.

This option is very usefull for debugging large loops.

Message Edited by Wim S on 04-11-2006 06:09 PM

0 Kudos
Message 2 of 7
(3,885 Views)

Hello Wim S,

Thanks for your reply quickly! I have tried it , it is working now Smiley Happy

I set both Pass Count and Condition at the same time, Why the breakpoint doesn't work any more. Example as above,

Pass count  :  20 

Condition : counter == 15

What's the relationship of Passs Count and condition?

 

 

 

0 Kudos
Message 3 of 7
(3,880 Views)

Hello Taxi,

I tried a few combinations and it seems that if Pass Count and Condition are both set, the debugger never breaks, even if Pass Count is set to 20 and Condition is set to counter == 19.

If you want to use both the Pass Count and the condition, first create the Pass Count breakpoint. Then in the Breakpoints window (Shift+F9) select the created breakpoint, and click the Add/Edit Item button. In the Edit Breakpoint window, set Pass Count to 0 and enter your Condition. Now, instead of clicking the Replace button, click the Add button. This causes two breakpoints to be created in the same file at the same line.

Message Edited by Wim S on 04-12-2006 09:20 AM

0 Kudos
Message 4 of 7
(3,856 Views)

With pass count set to 20 and condition counter==15 my system would break on the 20th evaluation of counter.  That is the 20th time counter was either set or compared in a statement in which the value of the counter was 15.  This was using CVI6.

So it seems the behavior is that the condition must evaluate to true for the number of times set in pass count for the break point to execute.

This snippet will break when i=39, counter=15

   counter=0;
   for (i=0; i<100; i++)
     { if (counter==0)
          counter=15;
       else
          counter=0;
     }

Message Edited by mvr on 04-12-2006 07:51 AM

0 Kudos
Message 5 of 7
(3,846 Views)

Forgot to add the break point was set on the if() statement. 

Also it will break at both i=39 and i=79.

0 Kudos
Message 6 of 7
(3,836 Views)

Hello Wim S and mvr,

I have got some information about conditional breakpoint from training material

To stop the program only when the condition has occurred 50 times.

0 Kudos
Message 7 of 7
(3,812 Views)