Printing VIs

Print or save VIs and VI documentation to keep a record you can refer to later. You can use the following primary ways to print VIs:

You can configure how LabVIEW prints a VI when you select File�Print Window or when you print programmatically by selecting File�VI Properties.

Printing the Active Window

You can print the contents of the active front panel or block diagram window by selecting File�Print Window. LabVIEW prints the workspace of the active window, including any objects not in the visible portion of the window. LabVIEW does not print the title bar, menu bar, toolbar, or scroll bars.

Printing Documentation

You can print VI documentation or save it to HTML, RTF, or text files by selecting File�Print. You can select whether to print documentation for a single VI or for multiple VIs. You also can select a built-in documentation style or create a custom style for documentation.

The documentation you create can include the following items:

Note��The documentation you create for certain types of VIs cannot include all the previous items. For example, a polymorphic VI does not have a front panel or a block diagram, so you cannot include those items in the documentation you create for a polymorphic VI.

Saving Documentation to HTML, RTF, or Text Files

You can save VI documentation to HTML, RTF, or text files. You can import HTML and RTF files into most word processing applications, and you can use HTML and RTF files to create compiled help files. You also can use the HTML files LabVIEW generates to display VI documentation on the Web. You also can print and save documentation to HTML, RTF, and text files programmatically.

When you save documentation to an RTF file, specify if you want to create a file suitable for help files or for word processing. In the help file format, LabVIEW saves the graphics to external bitmap files. In the word processing file format, LabVIEW embeds the graphics in the document. For HTML files, LabVIEW saves all graphics externally in the JPEG, PNG, or GIF formats.

Selecting Graphic Formats for HTML Files

When you save documentation to an HTML file, you can select the format of the graphics files and the color depth.

The JPEG format compresses graphics well but can lose some graphic detail. This format works best for photos. For line art, front panels, and block diagrams, JPEG compression can result in fuzzy graphics and uneven colors. JPEG graphics are always 24-bit graphics. If you select a lower color depth such as black-and-white, graphics save with the depth you requested, but the result is still a 24-bit graphic.

The PNG format also compresses graphics well, although not always as well as the JPEG format. However, PNG compression does not lose any detail. Also, it supports 1-bit, 4-bit, 8-bit, and 24-bit graphics. For lower bit depth, the resulting graphic compresses much better than JPEG.

LabVIEW does not save graphics as compressed GIF files. Use a graphics format converter to convert the uncompressed GIF files that LabVIEW saves to compressed GIF files. For higher quality compressed GIF files, select the PNG format when you save the documentation and use a graphics format converter to convert the PNG files that LabVIEW saves to GIF files. Starting with the PNG format produces higher quality graphics because the PNG format is an exact reproduction of the original graphic. Modify the HTML file that LabVIEW generated to refer to the GIF files with the .gif extension.

Naming Conventions for Graphic Files

When you generate HTML or RTF documentation with external graphics, LabVIEW saves the control and indicator data type terminals to graphic files with consistent names. If a VI has multiple terminals of the same type, LabVIEW creates only one graphic file for that type. For example, if a VI has three 32-bit signed integer inputs, LabVIEW creates a single ci32. x file, where x is the extension corresponding to the graphic format.

Creating Your Own Help Files

You can use the HTML or RTF files LabVIEW generates to create your own compiled help files. (Windows) You can compile the individual HTML files LabVIEW generates into an HTML Help file. (macOS) You can use the individual HTML files LabVIEW generates in Apple Help.

You can compile the RTF files LabVIEW generates into a (Windows) WinHelp or (Linux) HyperHelp file.

Providing Custom Documentation for VIs and Applications

To provide custom documentation from the Help menu, place a custom help file in the labview\help directory. (Windows) You can use any file type except text files for custom documentation. (macOS and Linux) You can use only HTML (.html and .htm) and PDF files.

Note��(Linux) To use a PDF file for custom documentation, you must have one of the following PDF viewers installed:
  • Acroread
  • Xpdf
  • KPDF
  • GGV

Complete the following steps to display custom help in the Help menu:

  1. Place the custom help file in the labview\help directory.
  2. Place a text file that has the same name as the custom help file in the labview\help directory. Within the text file, include the help title you want to display in the Help menu.

    For example, if you name the help file My Custom Help.html, you must name the text file that contains the menu title My Custom Help.txt.
Note��The only information you must provide in the text file is the custom help title you want to display in the Help menu.

Linking to Web-Based Help from a VI

To link a VI to web-based documentation from the Context Help window, select the Web-based Help option from the drop-down menu on the Documentation page of the VI Properties dialog box. Use the Help URL text box to specify the URL of the topic to which you want to link.

You also can use the Use Web URL and the Document Web URL properties to link a VI to web-based documentation programmatically.

Linking to Local Help from a VI

To link a VI to local documentation from the Context Help window, select the Local Help File option from the drop-down menu on the Documentation page of the VI Properties dialog box. Use the Help path text box to browse to custom documentation on the local computer. Optionally, use the Help tag text box to link the VI to a specific topic within a compiled help file or to link to a bookmark within an HTML help file. Otherwise, leave the Help tag text box empty.

For example, if you specify to use a compiled help file named My Custom Help.chm in the Help path text box, you can enter GettingStarted.html#Intro in the Help tag text box so the Detailed help link in the Context Help window links directly to introductory information in the compiled help you provide. However, if you specify to use a PDF file named My Custom Help.pdf in the Help path text box, leave Help tag empty because you can link a VI to a specific topic or a bookmark within a topic only if the topic is an HTML file or an HTML file within compiled help.

You also can use the Document Tag and the Document Path properties to programmatically link a VI to a local help file.

Printing VIs Programmatically

Use any of the following ways to programmatically print VIs or data the VIs return:

Note��If you print VI documentation from a stand-alone application, you can print only the front panels.

Printing the Front Panel of a VI after the VI Runs

Select Operate�Print at Completion to print the front panel of a VI when it finishes running. You also can select File�VI Properties, select Print Options from the Category pull-down menu, and place a checkmark in the Automatically Print Panel Every Time VI Completes Execution checkbox.

Selecting these options is similar to selecting File�Print Window when the front panel is the active window.

If you use the VI as a subVI, LabVIEW prints when that subVI finishes running and before the subVI returns to the caller.

Using a SubVI to Print Data from a Higher Level VI

In some cases, you might not want a VI to print every time it finishes running. You might want printing to occur only if the user clicks a button or if some condition occurs, such as a test failure. You also might want more control over the format for the printout, or you might want to print only a subset of the controls. In these cases, you can use a subVI that is set to print at completion.

Create a subVI and format the front panel the way you want LabVIEW to print it. Instead of selecting Operate�Print at Completion in the higher level VI, select it in the subVI. When you want to print, call the subVI and wire the data you want to print to the subVI.

Generating and Printing Reports

Use the Report Generation VIs to print reports or to save HTML reports that contain VI documentation or data the VI returns. Use the Print VI Panel or Documentation VI to generate a basic report that contains VI documentation. Use the Create Easy Text Report VI to generate a basic report that contains data the VI returns. Use the other Report Generation VIs to generate more complex reports.

Use the Report Express VI to generate a preformatted report that contains VI documentation, data the VI returns, and report properties, such as the author, company, and number of pages.

Use the Report Generation VIs to perform the following tasks:

Additional Printing Techniques

If standard LabVIEW printing methods do not meet your needs, you can use the following additional techniques: