LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hide the Debugging window

Solved!
Go to solution

Hi,

I'm creating an addon based on an external DLL programmed in C. Inside the DLL I call to DbgPrintf to print details about the DLL load, internal behavior, etc. That makes the Debug Window to show and print those messages. That window, however, might not be useful for some users, making the usage experience a bit hard. I'd like to hide that window somehow and let the user decided whether to show the debug window or not.

 

Is there a way to hide the Debugging window from LabVIEW so it's not shown although DbgPrint is called inside the C code?

 

Thanks!

0 Kudos
Message 1 of 5
(3,000 Views)

Hi SaraGr,

 

So first of all is the window that is popping up a LabVIEW window or a Windows console application? If it is a console then the function you are calling is what is causing the window to pop up. I would recommend looking into another printf function. Also what exactly are you trying to do. If you are trying to print to screen look for a appropriate printf function. If you are trying to pass values or strings, LabVIEW is able to handle this easily. You can pass it by reference or use data value references to pass information between memory locations. If you can give me a little more detail as to what you are trying to accomplish that will help me to understand the issue better. 

Ryan
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(2,959 Views)

Hi Ryan,

 

Thanks for your answer 🙂

 

I'm creating an Addon that integrates a DLL with LabVIEW. Inside the DLL's code, I'm using some of the LabVIEW functions to transfer data (as you suggested). I'm also using a function called DbgPrintf, included in extcode.h. That function opens a "LabVIEW console"... it is a window called "Debugging window" and it's not a Windows console. In the documentation explains the following:

 

LabVIEW has a debugging window you can use with external code to display information at run time. You can open the window, display arbitrary print statements, and close the window from any CIN.

[...]

DbgPrintf(""); /* print an empty line, opening the window if necessary */
DbgPrintf("%H", var1); /* print the contents of an LStrHandle (LabVIEW string-->, opening the window if necessary */
DbgPrintf(NULL); /* close the debugging window */

 

I would like to use this to allows users to debug the DLL from LabVIEW. That way an advanced user would enable the Debugging window and see what is going on. The problem is whenever I include a call to DbgPrintf call in my code the Debugging window is shown. That might be confusing for non-advanced users. So I was looking for a way to enable/disable that Debugging window from LabVIEW.

 

Do you have any ideas/suggestions?

 

Thanks,

Sara

0 Kudos
Message 3 of 5
(2,936 Views)
Solution
Accepted by SaraGr

You could manage debugging enable/disable into your C code:

if (iDbg) {

    print debug info...

}

 

iDbg could be either an argument passed to your function or a static variable that you may switch on/off with a dedicated function:

 

static int iDbg;

void DebugEnable(int iEnable)

{

   iDbg=iEnable;

   return;

}

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 4 of 5
(2,927 Views)

Thanks Paolo!! That fixed my problem.

 

In fact, what I did is create an entry in the Tools Menu so you can easily access to the Enable/Disable option.

 

Thanks again!!

0 Kudos
Message 5 of 5
(2,889 Views)