Printing VIs

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

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:

  • Select File»Print Window to print the contents of the active window.
  • Select File»Print to print more comprehensive information about a VI, including information about the front panel, block diagram, subVIs, controls, VI history, and so on.
  • Programmatically print or save a VI or a report that contains VI documentation or data the VI returns.

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:

  • Icon and connector pane
  • Front panel and block diagram
  • Controls, indicators, and data type terminals
  • Labels and captions for controls and indicators
  • VI and object descriptions
  • VI hierarchy
  • List of subVIs
  • Revision history
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. (Mac OS X) 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.

After creating and compiling the help files, add them to the Help menu of LabVIEW or to the custom application by placing them in the labview\help directory.

Create links from VIs to HTML files or compiled help files by selecting File»VI Properties and selecting Documentation from the Category pull-down menu.

Printing VIs Programmatically

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

  • Set a VI to automatically print its front panel every time it finishes running.
  • Create a subVI to print the VI.
  • Use the Report Generation VIs to print reports or to save HTML reports that contain VI documentation or data the VI returns.
  • Use the VI Server to programmatically print a VI window or to print VI documentation or save it to HTML, RTF, or text files at any time.
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 Easy Print VI Panel or Documentation VI to generate a basic report that contains VI documentation. Use the 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:

  • Append text, graphics, tables, or VI documentation to a report.
  • Set text font, size, style, and color.
  • Set the report orientation—portrait or landscape.
  • Set the report headers and footers.
  • Set margins and tabs.

Additional Printing Techniques

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

  • Export data to other applications, such as Microsoft Excel, save the data to a file, and print from the other application.
  • Use the System Exec VI.
  • (Windows) Use ActiveX to make another application print data.


Not Helpful