LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

global variable for DEBUG config type?

I have a timer based program that gets all cranky when I try to debug.  i was looking for a global variable so in my code I could do the following:

 

#ifndef DEBUG_MODE

elapsed_time = difftime(....)

#else

elapsed_time++;

#endif

 

Is this possible in CVI based on the config type so I don't have to recomment a line of code each time?

 

Thanks

0 Kudos
Message 1 of 3
(3,223 Views)

The macro _CVI_DEBUG_ is defined and has the value of 1 if you're running a debug build of an application.

0 Kudos
Message 2 of 3
(3,221 Views)

There's a function too,

 

BeingDebuggedByCVI ( )

 

returns 1 if true, 0 otherwise.

 

So if you want compile time selective compile of code when doing a debug build, you can use the macro.

 

If you want the code to determine at runtime if it's being debugged, use the function.

Message 3 of 3
(3,220 Views)