× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Sending ESC codes to a HP5 printer
  • From: pault@xxxxxxxxx (Paul Tykodi)
  • Date: Thu, 30 Apr 1998 16:53:47 -0400

Vern Hamberg wrote to midrange-l
Carl
At 09:14 PM 1/27/1998 -0500, you wrote:
>Does anyone have any experience sending ESC codes to a HP5 (PLC5) printer
>to select a bin.  I need to know how to do this in RPG.  I know what the
>esc seq should be, just don't know exactly how to send it to the printer.

We do lots of PCL to HP printers. Sending the ESC (x'1B') code causes
problems.  You can get around this by creating a WSCST (workstation
customization object) with a translation table (:EBCASCTBL) section. You
need to select one of the characters to represent your ESC code (we use
EBCDIC x'9e' or some such). You put the table after the
:ASCCPINFO.-:EASCCPINFO. section.

Use RTVWSCST to get the source. You get the same list of manufacturer/model 
values you get in CRTPRTF. Then insert the table section as stated above.  
Finally, use CRTWSCST to create a new one. Set mfrmdl in CRT/CHGPRTF to *WSCST 
and specify your nes WSCST in the WSCST parameter.
<much information deleted>

Dear Carl,

Another way to accomplish the same task is to use the OS/400 feature called 
ASCII Transparency (ATRN). This operating system feature is the tool that 
allows the Client Access Virtual Printing and the Host Print Transform 
functions to operate correctly. The SCS hex code 03 followed by a count byte is 
the ATRN command. It tells the OS/400 operating system how many bytes of ASCII 
data are following its occurrence. 

If for example you wanted to send the HP PCL command for portrait from an RPG 
field, you could code the following values (in hex) into the field 03 05 1B 26 
6C 30 4F. The AS/400 operating system would move the information to the target 
printer for you, without interrogating it for data integrity, because it would 
already know that it was ASCII formatted data.

If you want to get creative and pass large amounts of ASCII data in this 
fashion, you need to insert the values 03 FF into your ASCII file at 255 byte 
intervals.

HTH

/Paul
--
Paul Tykodi, Technical Director                 E-mail: pault@praim.com
Praim Inc.                                           Tel: 603-431-0606
140 Congress St., #2                                Fax: 603-436-6432
Portsmouth, NH  03801-4019


+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.