SV650.org - SV650 & Gladius 650 Forum

SV650.org - SV650 & Gladius 650 Forum (http://forums.sv650.org/index.php)
-   Idle Banter (http://forums.sv650.org/forumdisplay.php?f=116)
-   -   IT - Printer Escape Comands (http://forums.sv650.org/showthread.php?t=66912)

TSM 24-02-06 05:30 PM

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?

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

Quote:

Originally Posted by Iansv
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

Quote:

Originally Posted by TSM
Quote:

Originally Posted by Iansv
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

Quote:

Originally Posted by Sudoxe
Quote:

Originally Posted by TSM
Quote:

Originally Posted by Iansv
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

Quote:

Originally Posted by rigor
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):
Code:

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

Re: IT - Printer Escape Comands
 
Quote:

Originally Posted by TSM
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. 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.