LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Code breaks at an API function though there is no break point .

Solved!
Go to solution
I am working with Pro Essentials Graphs with CVI 8.5. When I am debugging my application, occasionaly bugger stops at one of the API functions(No braek point at the point). I have to click on "continue" button to continue debugging. This happens for several times and my application crashes after some time.
0 Kudos
Message 1 of 10
(4,544 Views)

Hi Ramesh,

 

There might be 2 reasons for that: 

 

1) You might have set a variable to be watched and code to break at the point its value changes.

Make sure there are no variables in the watch window. 

 

Just go to "Window >  Watch" from the CVI IDE menu and delete any variables listed using the Delete button on your keyboard.

 

2) "Library errors" is enabled in the menu "Run > Break on".

This only happens if you are in debug mode and at the point of break a popup appears showing details about the error encountered.

 

Which one is the case for you? 

S. Eren BALCI
IMESTEK
0 Kudos
Message 2 of 10
(4,539 Views)

Hi Eren,

 

I did not use watch window option. Also I am not getting any error message when it breaks at that point. Please inform me if there is anything else that causes it.

 

Thanks,

Ramesh

0 Kudos
Message 3 of 10
(4,516 Views)

Well, that was all I could guess.

I do not know any other case that may result in such behaviour.

NI's professionals may comment better at this point, since this looks like an abnormal situation. 

 

Did you look for anything unusual in the variable values at the moment the code breaks?

Is it always the same point in the code that causes the break? 

Message Edited by ebalci on 08-03-2010 08:26 AM
S. Eren BALCI
IMESTEK
0 Kudos
Message 4 of 10
(4,510 Views)

I can confirm this happening sometimes. It just breaks as if a breakpoint was hit (no runtime error or anything). I was too busy to investigate any further, however, as it was just a nuisance.

Regards, Marcel

0 Kudos
Message 5 of 10
(4,472 Views)
Solution
Accepted by topic author Ramesh_Pitchuka
Thanks Guys. I found the issue. It is due to asnchronous timers that I used in Windows.
0 Kudos
Message 6 of 10
(4,449 Views)

Ramesh, what do you mean by "...asnchronous timers that I used in Windows..."?

 

Even if you have timers in your code it should not cause CVI to break if there is not a breakpoint (either normal or watch window triggered) in your timer callback.

S. Eren BALCI
IMESTEK
0 Kudos
Message 7 of 10
(4,437 Views)
Earler, I used CVI asynchrounous timer for data update in graphs. I am working with a PC loaded with Windows XP. When I used timer control of CVI instead of asynchronus timer, I observed that the code is not breaking now.
0 Kudos
Message 8 of 10
(4,433 Views)

What is the refresh rate for your graphs? or what is the period of the timer control? 

 

You may end up using the async timers again, if you need a fast and more-or-less stable refresh rate.

 

Beware that, async timer callbacks run on a separate thread.

Therefore they are effected less from the other Windows background operations compared to timer controls.

S. Eren BALCI
IMESTEK
0 Kudos
Message 9 of 10
(4,421 Views)

I am working at 100ms in which I will get from a server using TCP/IP communication and updating graph. I am using semaphore and waitforSingleobject with infinite time and releasing the semaphore after getting the data and updating graph. If  I do so, I found that my application is hanging sometimes and breaking at a particular point in the timer.

 

 

0 Kudos
Message 10 of 10
(4,414 Views)