LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Print panel to selected printer

I am trying to use the NI library function "Print panel to printer.vi" sited at http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3E9F956A4E034080020E74861&p_node=DZ52084&p_source=external.

The vi that I want to print is a graph that I must pass parameters to that contain the data that is to be graphed. I want to select the printer and printer the graph as a panel. The "print panel to printer.vi" requires that I give it the name of vi, which is fine, but it prints a blank graph because there is no way to pass the data.

How can I use this "print panel to printer.vi" yet still get the data to it? It was suggested to put the "print panel to printer.vi" inside the graph vi, but that does not work either. What
am I doing wrong?

Steve Hope
0 Kudos
Message 1 of 12
(3,971 Views)
Hello Steve

I do not have a direct answer to your question but the idea which can be helpful.

Did you try to build your own "Printer dialog". It is quite easy.

I enclose a vi which can give you a tools to build you own print dialog box.
It can look axactly like the windows one, and it can contain you own functionality.

hope it helps.
Pawel
0 Kudos
Message 2 of 12
(3,971 Views)
Why is there no way to pass data to the graph? That sounds like your major problem and not the printing. Do you have a connection on the subVI's connector pane? Is the subVI not visible when you want to do the printing?
Message 3 of 12
(3,971 Views)
Ah, this is why no one has understood me!

Yes, I have the graph on a nice looking front panel then I offer a control to print the graph. This calls ANOTHER graph vi, that has a vary similar front panel but with white background and black graph and data to be a little more printer friendly. It works great if I "print panel upon completion" but it does not allow me to select a different printer. Is this clearer?

Steve
0 Kudos
Message 4 of 12
(3,971 Views)
Okay, I think I understand. If you're calling the print panel before the subVI has it's data, then the panel will be blank. You should be able to put the select printer function inside the subVI. You just have to make sure that the data is updated before the print function is called. It would then act like the print panel up[on completeion. If you post your subVI, someone could look at it to see why you're having trouble.
0 Kudos
Message 5 of 12
(3,971 Views)
Dennis:

Here is the vi that I am trying to print. Notice that I am passing a bunch of things to it from the VISIBLE graph that is in the application. One of the things is the name of the printer that I want to graph to go to. Can you help?

Steve
Download All
0 Kudos
Message 6 of 12
(3,971 Views)
I had no problem getting it to print once I added some code to get the name of the VI to print. All I did was put a Current VI's path function and a single Strip Path to get the name of the VI and wired that to the VI Name input of Print Panel to Printer. The modification is shown in the attachment.
0 Kudos
Message 7 of 12
(3,971 Views)
That is what I had done, but I do not get data in the graph. It is as if it takes a while for the data to be graphed before it is available? Try sticking some data into the input array and see it it appears in the graph when YOU print!

S
0 Kudos
Message 8 of 12
(3,971 Views)
Right click on the graph and select Advanced>Synchronous Display. This will ensure that the data on the front panel is updated before the diagram completes.
0 Kudos
Message 9 of 12
(3,971 Views)
That seemed to be it. It works fine. THANKS!
0 Kudos
Message 10 of 12
(3,971 Views)