07-21-2009 11:15 AM
So it looks like I was a bit preemptive in declaring a solution in the thread below
http://forums.ni.com/ni/board/message?board.id=170&thread.id=425404
What I'm looking to do is use LabVIEW to check whether any printers are available ONLINE before I proceed with a print. Using the printing property nodes appear to only return a list of configured/installed printers on Windows regardless of whether they're connected or powered on.
Any suggestions?
07-21-2009 01:40 PM
07-21-2009 01:57 PM
Hey Darin,
Thanks for the response. The main issue I have is that the LabVIEW executable hangs up when the user requests a print and nothing is connected or turned on. In this scenario it would ideally return an error and cancel the print. At the very least, it shouldn't hang up even if the queue remains. The only way I can get out of this hang up is by turning the printer on or cancelling the print job through windows. A timeout error would help resolve this issue, but this functionality does not appear to be available. I've considered attempting to query printer status through a Windows command line request through LabVIEW or checking the status of all LPT ports. Unfortunately, I'm not really familiar with these topics and I have a limited time frame in which to get this done. If there was a way to at least avoid/detect this hang up, it would be sufficient (even if the printer job was put on queue). I'll take a look at the .NET property you specified and see if I can use it for this functionality.
Thanks.
07-21-2009 08:18 PM
Darin,
I tried the attached VI to see if I could at least take a look at the printer queue properties for testing purposes, but so far I only had luck getting back a name property. This only worked on one of my systems (on a local network) running Windows XP. On the other (not connected to any network), the program crashed. You see anything wrong with the references used in the attached code? I have determined that if I enable spooling on my printer, the easyprint VI at least won't hang up the LabVIEW executable.
07-22-2009 12:05 PM
07-22-2009 12:09 PM
07-22-2009 12:40 PM
07-22-2009 01:24 PM
I see. Yeah, the computer this wasn't working on is an older version of Windows XP which does not come with this system.printing.dll. So yeah, it looks like the properties are processed very quickly during a basic print. I think the best I can do in this case is to wait maybe 50-100 ms to print and then check if there are any jobs in the queue. If there are, I could then send a warning message to the user. I'll have to settle for that since there doesn't seem to be an easy way to check for available printer hardware connections, thanks.
01-25-2010 12:59 PM
I am having the same issue. I would love to try the VI that was posted but I have labview 8.0.
Can someone please save this VI back for earlier revision use?
01-26-2010 12:33 PM
I suppose...