Results 1 to 9 of 9
  1. #1
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    NY, NY, USA
    Posts
    654
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Embedded printer commands to Decimal Form

    I need to convert
    Esc*r3U ESC*v1S To turn all print to RED and then
    Esc*v0S EscE for return to black text
    THis is for a dos promgram that takes printer codes in decimal form.
    Thanks
    Jerome

  2. #2
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Embedded printer commands to Decimal Form

    If all you want to have is the decimal equivalent of each character in your escape sequences, you simply need to find an ASCII-to-decimal table, surely! Lucky I'm feeling charitable this afternoon...

    Esc * r 3 U ESC * v 1 S
    027 042 114 051 085 027 042 118 049 083

    Esc * v 0 S Esc E
    027 042 118 048 083 027 069

    Pity there's no fixed-pitch font on the board?

    Beware that ESC E does a complete Reset in HP PCL...
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Embedded printer commands to Decimal Form

    The <!t>[pre]<!/t> and <!t>[/pre]<!/t> tags can be used not only to preserve indentation in code, but also to display text in Courier:<pre>Esc * r 3 U ESC * v 1 S
    027 042 114 051 085 027 042 118 049 083</pre>

    <pre>Esc * v 0 S Esc E
    027 042 118 048 083 027 069</pre>


  4. #4
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Embedded printer commands to Decimal Form

    It's amazing how much I don't know, isn't it!! <img src=/S/blush.gif border=0 alt=blush width=15 height=15>
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  5. #5
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    NY, NY, USA
    Posts
    654
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Re: Embedded printer commands to Decimal Form

    Wow thanks to all
    CAN I COMBINE CODES SO THAT I would get Esc*r3u*v1S combined since there are multible escapes for the red. test
    027 42 114 051 117 42 118 049 083
    Is this okay??
    Jerome

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Embedded printer commands to Decimal Form

    Don't have the slightest idea, but why not experiment? You don't risk more than having to reset the printer if it fails, do you?

  7. #7
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    NY, NY, USA
    Posts
    654
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Re: Embedded printer commands to Decimal Form

    Will do, am travelling for the next few weeks, so won't be able to try till then. Thanks
    Jerome

  8. #8
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Embedded printer commands to Decimal Form

    You can only combine together specific types of HP PCL escape sequences, where the first three characters are the same,
    for example (all my examples have a blank character between letters to make them more intelligible; you don't have them in the actual commands!)
    <pre>ESC & l 1 O and ESC & l 2 A</pre>

    where the first three characers are Escape, ampersand, and small L, to become
    <pre>ESC & l 1 o 2 A</pre>

    Note that the capital O is changed to a lower-case o when "embedded" in the string, and that the second ESC & l is removed

    Because the first three characters of the two commands are different, as in
    <pre>ESC * r </pre>

    and
    <pre>ESC * v</pre>

    you can't combine the two commands.

    The best example is when selecting the characteristics of fonts, where you could select each characteristic individually, as in
    <pre>ESC ( s 0 P ESC ( s 1 0 H ESC ( s 1 2 V ESC ( s 1 S ESC ( s 3 B ESC ( s 3 T</pre>

    which is successively, fixed pitch, 10 characters per inch horizontally, 12 points vertically, italic, bold, Courier font, which can be combined into a single command:
    <pre>ESC ( s 0 p 1 0 h 1 2 v 1 s 3 b 3 T</pre>

    But note that this is really only PCL 3; most laser printer drivers are at PCL 5e or 6, and you can't use this on PCL 6...

    I'm getting much of this from my "Hewlett-Packard LaserJet Series II Printer Technical Reference Manual", May 1987.
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  9. #9
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    NY, NY, USA
    Posts
    654
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Re: Embedded printer commands to Decimal Form

    Thanks for the education
    Because I cant combine I dont have enough room to put in all the decimal codes in my medical program.
    I can embed the actual code in the file, but am having trouble overwriting the E with the ctrl p esc which gives the printer esc code in a dos editor. It keeps jumping to the beginning of the file when I do it. Trying to put it into line 5( ie count 5 lines down)
    0,173,172,920
    0,0,6,2,63,"N",0,1,0,1,0,4,0,0,0,0,0,0,0,1,0,1,0,0 ,0,"NN00000N0000"
    0,"",0,0,0,0,0,0,0,0,0,0,0
    1,1,1,0,0,0,"","","NON-MCR HCFA 12/91"
    1,1,1,11,1058,0,"","","E*r3U E*v1S"
    1,3,1,0,0,0,"","","----LASER HCFA------"
    1,4,1,0,0,0,"","","Use this format for"
    1,5,1,0,0,0,"","","Private Ins/Generic"
    1,6,1,0,0,0,"","","Ver 7.11 or 8.00"
    1,7,1,0,0,0,"","","Notes to Installer:"
    1,8,1,0,0,0,"","","Several new fields"
    1,9,1,0,0,0,"","","are set to field 0"
    1,10,1,0,0,0,"","","You may substitute"
    1,11,1,0,0,0,"","","Extended Information"
    1,12,1,0,0,0,"","","Fields where desired"
    1,13,1,0,0,0,"","","update R&D 12/01/98"
    1,14,1,0,0,320,"","","zihcfa.lfg"
    1,15,1,0,0,324,"","10","signat.bmp,2920,300"
    1,25,1,0,0,324,"","300","barins.bmp,015,300"
    1,50,1,25,526,0,"","","pri. claim co. name"
    2,50,1,25,532,0,"","","pri. clm. co. attn."
    3,50,1,25,527,0,"","","pri. clm. co. street"
    4,50,1,25,528,0,"","","pri. clm.co. city/st"
    5,57,1,22,503,-69,"","1058","XXXXXXXXXX*ESTIMATE*"
    8,1,1,1,504,-50,"","","ins.type/medicare(2)"
    8,8,1,1,504,-49,"","","ins.type/medicaid(1)"
    8,15,1,1,504,-51,"","","ins.type/champus (3)"
    8,24,1,1,504,-52,"","","ins.type/champusva(4"
    8,31,1,1,504,-54,"","","ins.type/bcbs (6)"
    8,39,1,1,504,-53,"","","ins.type/feca (5)"
    8,45,1,1,504,-55,"","","ins.type/other (7)"
    8,45,1,1,504,-56,"","","ins.type/other (8)"
    8,45,1,1,504,-57,"","","ins.type/other (9)"
    8,50,1,17,505,0,"","","identification #"
    10,1,1,17,215,0,"","","patient last name"
    10,19,1,8,210,0,"","","patient first name"
    10,28,1,1,201,0,"","","patient middle init."
    10,31,1,2,212,0,"","","patient birth month"
    10,34,4,2,212,0,"","","patient birth day"
    10,37,7,4,212,0,"","DF1","patient birth year"
    10,42,1,1,213,-77,"","","patient sex (M)"
    10,47,1,1,213,-70,"","","patient sex (F)"
    10,50,1,16,554,0,"","","insured party lname"
    10,67,1,9,555,0,"","","insured party fname"
    10,77,1,1,556,0,"","","insured party minitl"
    12,1,1,25,17,0,"","","patient street addr."
    12,33,1,1,506,-83,"","","relat to ins.party/S"
    12,38,1,1,506,-72,"","","relat to ins.party/H"
    12,38,1,1,506,-87,"","","relat to ins.party/W"
    12,42,1,1,506,-67,"","","relat to ins.party/C"
    12,47,1,1,506,-68,"","","relat to ins.party/D"
    12,47,1,1,506,-79,"","","relat to ins.party/O"
    12,50,1,25,551,0,"","","ins.party address"
    14,1,1,15,18,0,"","","patient city"
    14,26,1,3,19,0,"","","patient state"
    14,35,1,1,0,-83,"","","marital status"
    14,41,1,1,0,-77,"","","marital status"
    14,47,1,1,0,-79,"","","marital status"
    14,50,1,15,557,0,"","","ins.party city"
    14,74,1,3,558,0,"","","ins.party state"
    16,1,1,10,12,0,"","","patient zip code"
    16,14,1,14,16,0,"","","patient phone #"
    16,35,1,1,0,-69,"","","employer/school"
    16,41,1,1,0,-70,"","","employer/school"
    16,47,1,1,0,-80,"","","employer/school"
    16,50,1,10,559,0,"","","ins.party zip code"
    16,64,1,14,0,0,"","","ins.party phone"
    18,1,1,17,654,0,"","","2nd.ins.prty last nm"
    18,19,1,8,655,0,"","","2nd.ins.prty 1st nm"
    18,28,1,1,656,0,"","","2nd.ins.prty initial"
    18,50,1,30,502,0,"","","ins.party group name"
    20,1,1,17,605,0,"","","2ndary insurance ID#"
    20,19,1,10,602,0,"","","2ndary ins.group #"
    20,35,1,1,701,-89,"","","relat to employ (Y)"
    20,41,1,1,701,-78,"","","relat to employ (N)"
    20,54,1,2,562,0,"","","ins.party birth mnth"
    20,57,4,2,562,0,"","","ins.party birth day"
    20,60,7,4,562,0,"","DF1","ins.party birth year"
    20,68,1,1,560,-77,"","","ins.party sex (M)"
    20,75,1,1,560,-70,"","","ins.party sex (F)"
    22,2,1,2,662,0,"","","2nd.ins.prty brth MM"
    22,5,4,2,662,0,"","","2nd.ins.prty brth DD"
    22,8,7,4,662,0,"","DF1","2nd.ins.prty brth YY"
    22,18,1,1,660,-77,"","","2nd.ins.prty sex (M)"
    22,24,1,1,660,-70,"","","2nd.ins.prty.sex (F)"
    22,35,1,1,702,-65,"","","accident - (A)uto"
    22,41,1,1,702,-78,"","","accident - (N)o auto"
    22,45,2,2,702,0,"","","accident state"
    22,50,1,30,0,0,"","","ins.prty emlp/school"
    24,1,1,28,0,0,"","","2nd.ins.emp/school"
    24,35,1,1,702,-79,"","","accident - (O)ther"
    24,41,1,1,702,-78,"","","accident - (N)o othr"
    24,50,1,25,526,0,"","","pri.claim ctr. name"
    26,1,1,25,626,0,"","","sec. claim co. name"
    26,52,1,1,600,-999,"","","2ndary ins. exists"
    29,6,1,17,2007,0,"","","note/sign. on file"
    29,55,1,17,503,-89,"","2007","note/SOF if assign=Y"
    30,38,1,12,1001,0,"","DF1","current date"
    32,2,1,2,703,0,"","","date 1st symptom MM"
    32,5,4,2,703,0,"","","date 1st symptom DD"
    32,8,7,4,703,0,"","DF1","date 1st symptom YY"
    32,37,1,2,719,0,"","","date sim ill beg MM"
    32,40,4,2,719,0,"","","date sim ill beg DD"
    32,43,7,4,719,0,"","DF1","date sim ill beg YY"
    32,54,1,2,708,0,"","","begin totl disab MM"
    32,57,4,2,708,0,"","","begin totl disab DD"
    32,61,7,4,708,0,"","DF1","begin totl disab YY"
    32,68,1,2,709,0,"","","end totl disabil MM"
    32,71,4,2,709,0,"","","end totl disabil DD"
    32,74,7,4,709,0,"","DF1","end totl disabil YY"
    34,1,1,25,258,0,"","","referring dr. name"
    34,28,1,15,277,0,"","","referring dr. ID #"
    34,54,1,2,710,0,"","","begin hospitaliz MM"
    34,57,4,2,710,0,"","","begin hospitaliz DD"
    34,61,7,2,710,0,"","","begin hospitaliz YY"
    34,68,1,2,711,0,"","","end hospitalizat MM"
    34,71,4,2,711,0,"","","end hospitalizat DD"
    34,74,7,2,711,0,"","","end hospitalizat YY"
    36,52,1,1,714,-89,"","","outside lab code (Y)"
    36,57,1,1,714,-78,"","","outside lab code (N)"
    36,65,1,8,715,0,"","","lab charges"
    38,3,1,10,160,0,"","lb2","diag.code 1st array"
    38,31,1,10,162,0,"","lb2","diag.code 3rd array"
    40,3,1,10,161,0,"","lb2","diag.code 2nd array"
    40,31,1,10,163,0,"","lb2","diag.code 4th array"
    40,50,1,15,718,0,"","","authorization #"
    43,1,1,0,0,2,"","","begin loop"
    44,1,1,2,88,0,"","","date of service MM"
    44,4,4,2,88,0,"","","date of service DD"
    44,7,7,4,88,0,"","DF1","date of service YY"
    44,11,1,0,81,-53,"","","transferd secondary"
    44,12,1,0,93,0,"","","service to date MM"
    44,13,4,0,93,0,"","","service to date DD"
    44,16,7,0,93,0,"","","service to date YY"
    44,19,1,2,79,0,"","","place of service"
    44,22,1,0,80,0,"","","type of service"
    44,26,1,7,106,0,"","","service code"
    44,34,1,6,69,0,"","","modifier code"
    44,42,1,1,152,0,"","","diag ref 1"
    44,43,1,1,172,-997,"",",","print comma"
    44,44,1,1,172,0,"","","diag ref 2"
    44,45,1,1,182,-997,"",",","print comma"
    44,46,1,1,182,0,"","","diag ref 3"
    44,47,1,1,192,-997,"",",","print comma"
    44,48,1,1,192,0,"","","diag ref 4"
    44,51,1,7,1002,0,"","","net charge"
    44,58,1,4,118,-999,"","60","anesthesia minutes"
    44,58,1,4,118,-48,"","86","units of service"
    44,62,1,1,716,-89,"","Y","EPSDT (Y)"
    44,63,1,1,717,-89,"","Y","family plan (Y)"
    44,66,1,1,706,0,"","","emergency (Y/N)"
    56,1,1,0,0,3,"","","stop loop"
    56,1,1,15,407,0,"","","prac employer ID #"
    56,19,1,0,0,0,"","","if above changed mov"
    56,19,1,1,500,-999,"","","*tab 2 left if SS# *"
    56,23,1,15,1029,0,"","","acct # - claim #"
    56,38,1,1,503,-89,"","","accept assign (Y)"
    56,43,1,1,503,-78,"","","accept assign (N)"
    56,52,1,8,1006,0,"","","tot.net $"
    56,63,1,7,1010,0,"","","total receipts"
    56,72,1,7,1012,0,"","","total balance"
    57,56,1,14,305,25,"","","practice phone#"
    58,23,1,25,671,0,"","","serv. facility name"
    58,50,1,30,301,25,"","","practice name"
    59,3,1,18,2007,0,"","","note/sign. on file"
    59,23,1,25,673,0,"","","serv. fac. c/st/z"
    59,50,1,25,302,25,"","","practice address"
    60,50,1,25,303,25,"","","practice city/st/zip"
    61,19,1,12,1001,0,"","DF1","current date"
    61,52,1,12,319,20,"","","dr medicare #"
    61,66,1,14,312,25,"","","practice state id #"
    62,3,1,25,626,4,"","","2nd co name if xferd"
    63,3,1,76,2006,4,"","","note/partial pmt"
    61,66,1,14,412,0,"","","practice state id #"
    63,3,1,25,626,4,"","","2nd co name if xferd"
    64,3,1,76,2006,4,"","","note/partial pmt"
    64,3,1,76,2006,4,"","","note/partial pmt"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •