Page 1 of 3
USB Printing
Posted: Wed May 03, 2017 3:22 pm
by serge_girard
Hello,
Does anybody know how to print directly to a POS USB printer? I now have an old paraller POS printer which prints immdetialy after:
Code: Select all
SET DEVICE TO PRINTER
SET PRINTER ON
SET CONSOLE OFF
? 'lines'
SET PRINTER OFF
SET PRINTER TO
SET DEVICE TO SCREEN
SET CONSOLE ON
Thanks, Serge
Re: USB Printing
Posted: Wed May 03, 2017 3:44 pm
by quartz565
Re: USB Printing
Posted: Wed May 03, 2017 4:24 pm
by serge_girard
Thx Nikos, I will have a look at it!
Re: USB Printing
Posted: Wed May 03, 2017 6:23 pm
by mol
Hi Serge.
Do you connect this printer via USB-Centronics adapter?
You can set your printer as shared, then you can map it to lpt
eg.
net use lpt1 \\comp_name\shared_printer_name
After that, you can use your commands as you described
Re: USB Printing
Posted: Wed May 03, 2017 11:42 pm
by franco
Serge, I have printed to usb or network printers for many years.
To do so I always made a batch file to start my exe program. This way you can print to local or printers on the network.
You install the windows printer. then share it, I use a simple share name .. like star1. This is easier to set up.
If you are not printing to a local printer the computer you are printing to should be on same workgroup.
If you are printing local, you need your computer name and printer share name.
Here is eg: of batch file
myprogram.bat
echo off
cls
net use lpt1: \\mycomputername\star1 //set printer to lpt1 You can set any port.
myprogram.exe // prints to port instead of printer. Then all print commands can go to lpt1: not images text only.
net use lpt1: /delete // I always shut of link after program
//end batch file
At start of print procedures say set device to printer then
set printer to lpt1
then all print commands @ line,col say commands go to printer
I usually print some blank lines at end of print to set start of next printout
at end say set device to screen.
I hope this is what you where looking for.
Franco
Re: USB Printing
Posted: Thu May 04, 2017 6:29 am
by serge_girard
Thanks Franco, Marek and Nikos!
I think use net use in my start-batch file will be best solution: no changes in my programs!
I will try as soon as I have the printer.
Thanks again,
Serge
Re: USB Printing
Posted: Thu May 04, 2017 12:41 pm
by serge_girard
Franco, Marek,
When using NETUSE.. I must share the printer with a short name (which I did). Is it also necessary to change port from USB001 to LPT1?
Serge
Re: USB Printing
Posted: Thu May 04, 2017 3:56 pm
by mol
No,printer pirt should be usb.
Network mapping does the job.
Which windows version do you have?
Re: USB Printing
Posted: Thu May 04, 2017 4:16 pm
by serge_girard
W10-32 + W10-64 + W7-32
Printer has not yet arrived so I can not start testing. I let you know, thanks Marek!
Serge
Re: USB Printing
Posted: Thu May 04, 2017 4:59 pm
by mol
Ok