LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Report Print.VI redirects to the wrong printer if error on intended printer

I have an application that involves a Zebra barcode printer and an HP letter-sized printer, both connected via USB to an XP box running LV2011.  I need to send binary files directly to the label printer so I have it shared as LPT1 using NETUSE and I use COPY to get the file to the printer.  Works great, except for the flash as the DOS screen momentarily appears during the COPY command.  I can live with that.  Here's the problem: when I use Print Report.VI to send an HTML report to the letter-sized printer it comes out on the label printer if there is any issue with the intended printer (e.g. out of toner).  35 labels later....

 

1] is there any way to force the print to sit in the HP's queue instead of redirecting to the label printer? I believe the Print Report VI uses IE's default printer regardless of what you specify, so maybe it's also IE that's doing the substitution?

 

2] is there any way to query the HP printer's "health" before sending a job so I can avoid creating the issue in the first place? I read somewhere that Windows only knows the state of the printer at certain discrete (an not-so-informative) times.

0 Kudos
Message 1 of 2
(2,166 Views)

Hi Zwired1,

 

Just to make sure I fully understand the situation - I am assuming since you say you are printing to two different printers that when you are using the Print Report.vi you are using the printer name string to specify which printer you would like to print on. And if the printer that you specify is not functioning it automatically prints on the other printer, is that correct?

 

From looking at the code in the Print Report.vi, it looks like if you specify a printer name in the input string, if there is a problem with that printer or if that printer is unavailable, the VI should not print anything, so please let me know if that is not the behavior you are seeing.

 

For your question about checking the health of printers, there is a VI in the report gen toolkit called Query Available Printers. You can find it if you open up the Print Report.vi and choose the Standard Report instance, the Query Available Printers.vi is on the block diagram of that VI. It will return the list of available printers and the default printer.

 

I hope that helps,

 

0 Kudos
Message 2 of 2
(2,146 Views)