LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help! I can't print from an executable.

I've written a vi which prints a barcode to a small brother label printer and compiled it into an executable.  Both the exe and vi print when the printer is connected to my computer, but when I move it to the target machine it won't print.  The program seems to run fine, but nothing happens when I send the print command, nothing appears in the print manager.  There are three printers connected to this machine (2 local and one network), and I can't print to any of them using a labview executable, but can using other programs (microsoft word).  Using the "queary available printers" function, all three printers show up.  Any ideas why I can't get anything to actually print out?  Is there a source file I need to add when building an executable?
 
Both computers are running windows XP service pack 2.  I am using Labview 8.5, third quarter 2007.
 
Thanks,
 
Philip.
0 Kudos
Message 1 of 6
(3,988 Views)
Just a little more information-  The computer I'm trying to print from has Labview 6.1 installed as well as the LV8.5 runtime engine.  I built an executable on this machine using LV6.1 and was able to print from it.  Any ideas?
0 Kudos
Message 2 of 6
(3,979 Views)
There's a couple of things that are a bit unclear:
  • You say you move "it" to the target machine. Is "it" the exe or the VI, since in the previous sentence you mention that both the VI and the exe work if the printer is connected locally.
  • Is the label printer connected locally to the test machine, and then you move it, or are you trying to print from the target machine to the label printer when it's connected to another computer?
  • You said "nothing happens when I send the print command". What does this mean? Are you selecting File->Print? If so, are you doing this in the executable or with the VI running in the development environment on the target machine. If not, how are you "sending the print command"?
0 Kudos
Message 3 of 6
(3,961 Views)

Hi Philip,

How are you designating the printer in your executable? Is it possible that the executable is looking for the wrong printer?

Have you thought about wiring the default printer out of the query available printers to your printing vi?

You might also want to consider building a debuggable executable to see what error(s) you're getting.

I'm curious to see what the result is?

Regards,

Hillary E
National Instruments
0 Kudos
Message 4 of 6
(3,950 Views)
Sorry I wasn't very clear in my original question.  My goal is to print from an executable on a computer which does not have Labview 8.5 installed (It does have the runtime engine installed).  The printer is connected locally to this machine and I'm trying to print three lines of text by creating a new report, printing it, then closing it, all using the report generation tools.
 
I'm desiginating the printer by just using a text control wired to the printer name input of the print report vi.  I havn't wired the output of the queary printers to the print report vi, but I have copied and pasted this text manually to make sure the name was right.
 
How do I build a debuggable exe to check for errors?  This sounds useful!
 
I have found a work around for this problem, which was to create an installer for the executable and include every single additional installer.  I'm not sure which one it needed, but my executable worked after this was installed.
 
Do you have any idea which additional installer was needed as creating a 1 gig install file and installing this on multiple machines takes a lot of time!
 
Thanks for your help,
 
Philip.
0 Kudos
Message 5 of 6
(3,923 Views)

Hi Philip,

From the LabVIEW help: Before you build the application or shared library, you must enable debugging in the build specification. For an application, place a checkmark in the Enable debugging checkbox on the Advanced page of the Application Properties dialog box. This can be found by going to Help»Search the LabVIEW Help...»Index»Search "stand-alone applications, debugging".

I think you may want to see Page 9 of this document for more information about the requirements of building an exe that contains Report Generation Toolkits. You shouldn't need any installers other than LabVIEW 8.5 and any other drivers you are using in your vi.

Regards,

Hillary E
National Instruments
0 Kudos
Message 6 of 6
(3,890 Views)