![]() |
IT - Printer Escape Comands
The last time i had to worrey about doing printer escape commands was on a nix box about 4 years ago. In that time i have not done it so have forgotten realy how to do it.
Basicly i need to send some custom commands to a ND2700 (dot matrix) printer to do some stuff. This is the sequence: ESC [ P3 ; P0 SP r P being just single value like 3 which gets converted to 33 hex etc.. I put it first into HEX, but our finance system only accepts decimal so i converted it to. HEX: 1B 5B 33 3B 30 20 72 DEC: 027 091 051 059 048 032 114 I put this in a text file then do the folowing command: COPY nd.txt LPT2 /b All it does it print out the sequence instead of actualy doing what i want it to do (our printer can automaticly load diffrent types of paper into it). Any ideas? |
wha....... :?
:lol: Have you tried turning it off and on again ? |
Quote:
|
Quote:
|
Quote:
|
try dropping the /b
afaik your trying to send ascii commands to the printer, the /b may just confuse the issue .... but I'm probably wrong :) PM the txt file if you want, two heads better than one and all that |
Quote:
all the text file has is one of these lines (without the DEC/HEX bit): Code:
HEX: 1B 5B 33 3B 30 20 72 |
Re: IT - Printer Escape Comands
Quote:
I get Hex: 1B 5B 50 33 3B 50 30 53 50 72 Dec: 027 091 080 051 059 080 048 083 080 114 P seems to be missing at the start, and the ends different ... worth a try? |
I remember doing this years ago, but I don't have the doc's for it anymore. Though I could have sworn you need to set some jumpers so that it can be updated. Then set them pack for normal printing, I know I wasn't happy when some fool reset the printer and I had to sort the paper types out again.
|
Ah, Newbury Data - good printers, or they were 20 years ago when I last fiddled with one. Looking at the control codes you're trying, looks like it's doing Epson emulation, which seems to be an option. There's an Epson ref. manual here. It's a PDF file. Bin control looks like Esc EM - pg C-157. The EM code has a decimal value of 25, so a bin select command is just 3 bytes long. The best thing to use to create the file is [shock, horror], good old EDIT. You can enter a control code by typing a Ctrl-P first. Esc is Ctrl-[, EM is Ctrl-Y. So, at a command line, invoke EDIT with your target file name. Then enter ctrl-P, ctrl-[, ctrl-P, ctrl-Y, n, where 'n' is the ascii bin number.
Your COPY /b is what I'd do too. |
All times are GMT. The time now is 03:22 AM. |
Powered by vBulletin® - Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.