Log in

View Full Version : IT - Printer Escape Comands


TSM
24-02-06, 05:30 PM
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?

Iansv
24-02-06, 06:30 PM
wha....... :?


:lol: Have you tried turning it off and on again ?

TSM
24-02-06, 06:36 PM
wha....... :?


:lol: Have you tried turning it off and on again ?

Yep, dont try that silly trick with me me. :roll:

Sudoxe
24-02-06, 06:40 PM
wha....... :?


:lol: Have you tried turning it off and on again ?

Yep, dont try that silly trick with me me. :roll:
IS IT PLUGGED IN?

TSM
24-02-06, 06:42 PM
wha....... :?


:lol: Have you tried turning it off and on again ?

Yep, dont try that silly trick with me me. :roll:
IS IT PLUGGED IN?

no, i decided it was better to have it unplugged for no reason other than it made me feal better.

rigor
24-02-06, 06:44 PM
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

TSM
24-02-06, 06:52 PM
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

ive think i tried it without the /b

all the text file has is one of these lines (without the DEC/HEX bit):
HEX: 1B 5B 33 3B 30 20 72
DEC: 027 091 051 059 048 032 114

If its accepted it should not print out anything just change some settings, instead it prints the escape sequence.

rigor
24-02-06, 07:38 PM
This is the sequence: ESC [ P3 ; P0 SP r

HEX: 1B 5B 33 3B 30 20 72
DEC: 027 091 051 059 048 032 114

Any ideas?

I think you may have dropped a couple of characters in your ASCII > Hex > Dec conversion ..

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?

Grinch
24-02-06, 07:47 PM
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.

chazzyb
24-02-06, 10:29 PM
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. (http://support.epson.ru/products/manuals/000350/part1.pdf) 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.

TSM
25-02-06, 12:04 AM
Yep a Newbury, its quite a fast one 700-800cps with dual tractor only 3yrs old. It runs Epson emulation as its replacing a Epson thats half the speed, so makes it easier. Not as if it uses loads of epson commands, its mostly done through preset Macros set into the printer. Thats actualy what the code does above, sets the macro, but i think its a specific command to the type of printer.

It took me a couple of hours to get it to align properly with our PAYE slips. The finance prog (Pegasus Opera) has some weird setup which i cannot change as i dont know how to, says its a dos report.

I know it has no jumpers as it has a menu system, but nothing there realy to set apart from the Emulation/Code page and many other things to do with aligning the paper.

I will have more of a play on monday. It works though i just cant trust the muppets in the finance office to not get confused about the diffrent macros the printer has. So i want to do it all automated via the escape codes.

rigor: i will try what you have written.

Grinch
25-02-06, 11:00 PM
If you need one i've got a EDiT manual somewhere... :wink: