03-28-2013 06:18 PM
OK, what am I missing here?
I have these two lines of code in a function:
SetBreakOnLibraryErrors(0); rc = ClientTCPRead (g_hconversation, l_p, n, d);
And...I just got a break in the debugger:
NON-FATAL RUN-TIME ERROR: "tcpsupport.c", line 142, col 10, thread id 0x000029E4: Library function error (return value == -11 [0xfffffff5]). Timeout error
What gives?
03-29-2013 10:22 AM
Hi mzimmers,
It looks like the TCP read is timing out - it doesn't get any data in d ms.
03-29-2013 10:27 AM
Hi, Humphrey -
I should have been more specific in my question: I realize the error is a timeout. What I was wondering is, why am I breaking on this error, when I've explicitly disabled breaks on library errors in the line of code just before the read?
03-29-2013 01:23 PM - edited 03-29-2013 01:37 PM
I believe I discovered the problem. Somehow, I had selected Run->Break On->Library Errors, and evidently this setting overrides the programmatic control. (Please correct me if I'm wrong.)
Thanks for looking, and sorry for the red herring.
EDIT: no, that wasn't it. I just made sure I hadn't selected the above option, and I STILL got a break. Possible bug?
04-01-2013 03:16 PM
Hey mzimmmers,
I just tried this function, and it worked properly for me. I had to include utility.h, and then if I call SetBreakOnLibraryErrors(0) right before the ClientTCPRead call, I do not get an error popup. To clarify, are you seeing the popup box with the error, or does it just show up at the bottom of the screen?
04-01-2013 03:35 PM
I just tried it out and it seems to be working. Having Run»Break On»Library Errors selected should not be a problem as SetBreakOnLibraryErrors is used to temporarily disable that setting. Check that run-time checking is not disabled. Run-time checking is enabled when you set the debugging level in the Build Options dialog box of the Workspace window to Standard or Extended, and select a debug configuration.
04-01-2013 05:35 PM
Humphrey: do I understand you that, if the build configuration is set for debug, and if the level is "standard," then the programmatic call is essentially ignored? That would explain what I'm seeing.
Daniel: it's from memory, but I'm pretty sure I was getting the pop-up box as well.
Thanks.
04-02-2013 01:03 AM
According to this thread SetBreakOnLibraryErrors supersedes the menu item...
04-02-2013 10:30 AM
Yes, it seems to supersede the menu setting, but not necessarily the build options setting in the configurations dialog.
I know I'm just a newbie here, but I think the CVI team could have made this a bit less complicated.
04-02-2013 12:48 PM
It should work properly if the Build configuration is Debug and the Debugging Level in Build Options»Debugging Options is Standard or Extended. SetBreakOnLibraryErrors will have no effect if run time checking is disabled (see the section before Example code here: http://zone.ni.com/reference/en-XX/help/370051V-01/cvi/libref/cvisetbreakonlibraryerrors/).