LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Printing multiple copies with 'Easy Print VI Panel or Documentation'???

I would like to use 'Easy Print VI Panel or Documentation.vi' to print multiple copies of the front panel of a VI. Unfortunately, 'Easy Print VI Panel or Documentation.vi' doesn't seem to have a 'number of copies' argument the way that 'Print Report.vi' does.

You might think that you could wire a VI refnum into an Application Property Node, but the printing properties there don't seem to include a 'number of copies' property:

Properties > Printing > Block Diagram Scaling?
Properties > Printing > Front Panel Scaling?
Properties > Printing > Header Content >
Properties > Printing > Margins
Properties > Printing > Page Headers?
Properties > Printing > Page Orientation

To get around this, I
tried a number of things; for instance, I tried using 'Append Front Panel Image to Report.vi' in conjunction with 'Print Report.vi', but the results weren't pretty.

Any suggestions short of placing 'Easy Print VI Panel or Documentation' in a For Loop and looping the prints? [I'm not crazy about that because each call to the printer is very CPU-intensive.]

Thanks!
0 Kudos
Message 1 of 8
(3,571 Views)
Hello tarheel hax0r,

At the fundamental level, this VI calls an invoke node for the VI with the method �print VI to printer.� However it is used, to print multiple copies, it will have to be called twice. You are best off using the for loop, as multiple calls to the printer will be required, regardless of how you do it.

If none of these suggestions help, or if I�m not correctly understanding your issue, please reply with comments or answers to the discussion above and any additional information that may help, and I�ll be happy to look further into it.

Have a nice day!

Robert Mortensen
Applications Engineer
National Instruments
Robert Mortensen
Software Engineer
National Instruments
0 Kudos
Message 2 of 8
(3,571 Views)
At the fundamental level, this VI calls an invoke node for the VI with the method �print VI to printer.� However it is used, to print multiple copies, it will have to be called twice. You are best off using the for loop, as multiple calls to the printer will be required, regardless of how you do it.

Okay, I just wired a VI reference to an Invoke Node, and when I choose "Print VI to Printer" I get six properties:

Format
Scale Panel?
Scale Diagram?
Page Headers?
Page Breaks?
Section Headers?

but nothing that looks like "number of copies" [which is, I guess, what I would have hoped to have seen there].

I just wanted the researchers to have the ability to print a quick copy of what they're seeing on screen, but to print out more t
han one copy in case several people wanted to look at it. I tried using For Loops the other day, but it takes at least one second per copy to get the thing off to the printer, so what you see on screen has long since disappeared by the time you get to the second or third copy.

Obviously there are ways around this - buffering the data, freeze-framing a section of it, and then printing it from a separate thread, or flagging the metadata and then recreating and printing the data afterwards, but those kinds of solutions are a lot of work, and certainly wouldn't qualify as "Easy Print..."

Anyway, it sure would be nice to have "number of copies" functionality in "Easy Print..."
0 Kudos
Message 3 of 8
(3,571 Views)
 
PS: I did a little Googling the other night, hoping to find some sort of Registry setting that determined "Number of Copies" at the system level, but, from what I could tell, in Microsoft land, "number of copies" seems to be a property of the printer driver itself, not the Registry.

I do know that if you start up LabVIEW and print a dead [non-running] VI using plain old CTRL-P [i.e. File | Print...], then [if LabVIEW stays in memory in the interim] subsequent calls to "Easy Print" will remember the "number of copies" that the old "CTRL-P" sent to the printer, and will use that same number.

So if there were some way to influence that number in memory, it would solve my problem.
 
0 Kudos
Message 4 of 8
(3,571 Views)
If you just want to print the front panel, create a dummy VI which duplicates the panel of the VI you want to print (and has nothing but the print functions on the diagram). When the print button is pressed, pass the values from the active VI to the dummy panel, then print that from the for loop. It won't change values until the print button is pressed again.

Lynn
0 Kudos
Message 5 of 8
(3,571 Views)
 
create a dummy VI which duplicates the panel of the VI you want to print

Yeah, but the problem is that I need to freezeframe all the [instantaneous] data in the Waveform Graphs and Waveform Charts and pass it to the new window - .

But if LabVIEW has some nifty way to make a quick freezeframe and copy of the state of a Waveform Graph or a Waveform Chart, I'm all ears...

[Otherwise, as I indicated above, I've gotta code all that stuff by hand, which would be a day or more of work. A "number of copies" argument in "Easy Print" would be a lot easier.]
 
0 Kudos
Message 6 of 8
(3,571 Views)
Tarheel,

How are you setting the number of copies using -p? I could not see a LabVIEW option to set this number. It can be set on the printer properties, however, but this is printer-specific and has no reference to LabVIEW. It is possible that the printer will keep that setting for as long as LabVIEW is open, but again, that is printer specific.

If you want front panel data at a specific moment, you may want to look into using the �print screen� button on most keyboards (platform specific). Doing so will copy the front panel image to the clipboard. From there you could print as many copies as you wanted of the same data.

Have a nice day!

Robert Mortensen
Applications Engineer
National Instruments
Robert Mortensen
Software Engineer
National Instruments
0 Kudos
Message 7 of 8
(3,571 Views)
How are you setting the number of copies using -p? I could not see a LabVIEW option to set this number. It can be set on the printer properties, however, but this is printer-specific and has no reference to LabVIEW. It is possible that the printer will keep that setting for as long as LabVIEW is open, but again, that is printer specific.

Right - that's exactly what's happening.

It looks like in the way olden days, Win32 printer properties involved the "WINSPOOL.DRV" driver, and were difficult to access. It looks like maybe the number of copies was set via something called "dmCopies" ["DM_COPIES"] buried deep within a structure called "DEVMODE" which lived somewhere in the bowels of the Win32 printing and print spooling infrastructure:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/prntspol_8nle.asp?frame=true

The bottom line being that it doesn't look like the Win32 API relied on any sort of "number of copies" setting in the Registry, or stored any such information there for future reference.

In .NET, it looks like Microsoft has tried to "objectify" all of this, and now there's a "Copies" property in System.Drawing.Printing.PrinterSettings:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdrawingprinti...

Even in .NET, however, Microsoft still issues the warning Note Some printers might not support printing more than one copy at a time.

Anyway, like I indicated in a previous post to this thread, LabVIEW's "Print Report.vi" [which lives in "Functions Palette | All Functions | Report Generation"] does have an I32 input that allows you to set the "number of copies". It would be really nice if this same functionality were added to "Easy Print VI Panel or Documentation.vi", or if it were exposed somehow in the printing properties of "Invoke Node | Print VI to Printer" so that it could then be used by "Easy Print VI Panel or Documentation.vi".

Thanks!
0 Kudos
Message 8 of 8
(3,570 Views)