Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Debugging External Code

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

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.

To create this debugging window, use the DbgPrintf function. The format for DbgPrintf is similar to the format of the SPrintf function. DbgPrintf takes a variable number of arguments, where the first argument is a C format string, as shown in the following example:

int32 DbgPrintf(CStr cfmt, ..);

The first time you call DbgPrintf, LabVIEW opens a window to display the text you pass to the function. Subsequent calls to DbgPrintf append new data as new lines in the window. You do not need to pass in the newline character to the function. If you call DbgPrintf with NULL instead of a format string, LabVIEW closes the debugging window. You cannot position or change the size of the window.

The following examples show how to use DbgPrintf:

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 */

Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit