ycl
asked on
How to directly send ESC code to printer?
I want to send some ESC sequences directly to printer. How to do this?
ASKER
Your direction doesn't take effect,for instance when I send "chr(&H1b) & chr(&h40)" to EPSON LQ-1600 printer , It prints the sign "@",instead of initiate the printer.
I believe there's a control code you need to send before the escape code sequence indicating that an escape code sequence is about to follow. This differs by printer, but should be in the printer docs somewhere.
The ESC (escape) character is usually ASCII 27
Anytime you need to send an ESC preface the codes with ESC$
DIM ESC$
ESC$=CHR(27)
Printer.Print ESC$ & chr(&H1b) & chr(&h40)
(not the best naming convention - but I think you'll get the idea)
Anytime you need to send an ESC preface the codes with ESC$
DIM ESC$
ESC$=CHR(27)
Printer.Print ESC$ & chr(&H1b) & chr(&h40)
(not the best naming convention - but I think you'll get the idea)
Umm, scottsch, with the exception of naming ASCII 27 (which will work on many but not all printers), you've given the same information I did in my answer and comment ... frowned on in EE.
My original answer was correct, ycl needed some information on how to properly set up his escape code sequence beyond his original question.
My original answer was correct, ycl needed some information on how to properly set up his escape code sequence beyond his original question.
ASKER
I'm puzzled. Is 27 not equal to &h1B?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Ok you rejected the proposed answer. You find any of the other comments worthwhile?
M
M
Finalized.
Moondancer - EE Moderator
Moondancer - EE Moderator
dim e$
e$ = chr$(94) & chr$(108) ' & whatever
printer.print e$