Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
14 ratings:
 3.57 out of 5   

How Do I Print a Single Front Panel Control in LabVIEW?

Primary Software: LabVIEW Development Systems>>LabVIEW Full Development System
Primary Software Version: 7.0
Primary Software Fixed Version: N/A
Secondary Software: N/A

How Do I Print a Front Panel Control or Indicator (Such as a Graph, Chart, or Slider) in LabVIEW?

There are several ways to programmatically print a front panel control. Listed below are a few good methods:
  1. Method 1: Use the Report Generation VIs to generate and print a report.
    1. From the Report Generation palette, place the New on the block diagram.
    2. Next, place the Append Control Image to on the block diagram.
    3. From the block diagram, right click on your control and select Create»Reference. Attach this reference to the "Ctrl Reference" input of the Append Control Image to
    4. Place the Print on the block diagram.
    5. Place the Dispose on the block diagram.
    6. Connect the VIs as indicated in the PrintGraph.llb attached below (Note: Open the respective PrintGraph.llb depending on whether or not you have the Report Generation Toolkit installed).

  2. Method 2: Write image to a file and print.
    1. From the block diagram, right-click on the control and select Create»Invoke Node. Select the "Get Image" method.
    2. Place the Write JPEG on the block diagram and wire the "image data" output of the Invoke Node to the "image data" input of the Write JPEG (Note that other file formats, such as Bitmap and PNG, would also work here).
    3. Place the System from the Communications palette on the block diagram, and wire in a command to print the file. (Sending the string "mspaint.exe /p [jpeg file path]" will open the file in mspaint and print it). See the Printing Front Panel Objects in LabVIEW (6.1) example program (linked below) for an illustration of how this works.

  3. Method 3: Pass a control to a subVI and print the subVI. This method will print the control along with a front panel image. (These directions assume that you are using a graph, but other controls may also be used).
    1. Create a subVI with a graph on its front panel.
    2. Change the graph from an indicator to a control.
    3. Open the subVI and select Operate»Print at Completion.
    4. Assign the subVI a connector and pass the data from the graph on the main VI to the graph on the subVI. Every time your main VI calls the subVI, the subVI automatically prints the graph.

Related Links:
Developer Zone Example: Printing Front Panel Objects (Graphs, Charts, etc.) in LabVIEW (6.1)
KnowledgeBase 2PP7CM7Y: How Can I Save a Front Panel Control to a JPEG, PNG, or BMP File?
KnowledgeBase 239AKK6L: Printing Front Panels with 3D Controls



Report Date: 09/21/2000
Last Updated: 08/23/2017
Document ID: 21K6RNLI

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit