05-13-2009 10:12 AM
I am developing an application where the printer is on another computer and cannot be put on the network or shared and is too busy to be moved to my computer. I would like to be able to query for the presense of the printer before I print from labview. This would allow me to avoid having to disable the line to the printer when on my desktop and enable it when I build a test app that is run on the target machine. I can't send an IDN? since that is simply printed.
Any ideas?
Tay
Solved! Go to Solution.
05-13-2009 10:14 PM
What kind/brand of printer are you using? Is the LPT1 port setup to be bidirectional? I think you will need to look in the programming manual for the printer to see if there are any kind of special codes (such as escape codes) you can send that would cause it to respond back with information that you can read.
05-13-2009 10:22 PM
My first thought on how to solve this didn't turn out to be so easy.
Here's my second thought:
Make a configuration file on each PC. Only one parameter in it -- printer_exists (boolean).
Retrieve the key in the print part of your program... and if it's false, don't print it.
05-13-2009 10:33 PM
05-13-2009 10:36 PM
Nice idea Matt! This'll certainly work, but I do want to see if I can get it to return some kind of info first. I'll let you guys know tomorrow how it goes.
Tay
05-13-2009 10:45 PM
05-14-2009 03:23 PM
Well, I wasn't getting any response out of the printer to the commands I was sending, but if I read bytes at port on a PC with no printer I return an error code. If I read bytes at port on a PC with a printer I get 0 or perhaps some number. Viola!
Thanks guys!
Tay