LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

line number in error messages

Solved!
Go to solution

I make a number of IVI calls to varius instruments.  Recently I have experienced a seemingly random time out from one of the instruments.  I know what instrument is throwing up the error, but in the error handler, I would like it to report the source code line number where to IVI call occured so I can find which IVI call is causing the issue.

 

Here is the quote from the boss: "embellish our error checking macros with file name and line number macros. I know some compilers have them but not sure CVI does. This would help identify where these (and possibly others) errors come from."

0 Kudos
Message 1 of 5
(4,805 Views)
Solution
Accepted by topic author georgewbush

CVI offers __FILE__, __LINE__ and __ FUNCTION__ macros that are useful in these cases.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 5
(4,799 Views)

THANKS

0 Kudos
Message 3 of 5
(4,793 Views)

Don't you have to activate the C99 option in [Options][Build Options] in order to get those pseudo-macros ?

0 Kudos
Message 4 of 5
(4,652 Views)

I am currently using CVI2012SP1 and don't need this option enabled to use __FILE__, __LINE__ and __FUNCTION__macros.

I know it was necessary to add a macro in 8.5 to enable those elements, but I tested now and as of CVI2009 c99 extensions need to be enabled to evaluate those macros.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 5 of 5
(4,644 Views)