ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Printing BarCodes on ZEBRA Printer using RPG

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Printing BarCodes on ZEBRA Printer using RPG

    We need to start printing barcodes from our Iseries to a Zebra printer.
    Does anyone have any sample code(either internally defined printer file or externally) that I can use to print Bar codes on a Zebra printer..thanks

  • #2
    Re: Printing BarCodes on ZEBRA Printer using RPG

    Please...Please...Please look at mark magic or TLAshford for barcode software.
    They are both very easy to use and not very expensive.


    jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: Printing BarCodes on ZEBRA Printer using RPG

      Code:
            * Sticky labels for attachment to boxes etc.
      a002 FPM010PTB  O    F  264        PRINTER INFSR(*PSSR)
      a002 F                                     OFLIND(*IN57)
      a002 F                                     USROPN
      a002 F                                     INFDS(LINDS1)    
      ...
      ...
      ...
            *--------------------------------------------------------------------------------------------*
            *
            * Bar code printer file
      a002sOPM010PTB  E            bclabel     1
            *
            * Define the print format
           o                                              '¬XA'
           O          E            bclabel     1
           o                                              '¬DFPM010¬FS'
           O          E            bclabel     1
           o                                              '¬PRC'
           O          E            bclabel     1
           o                                              '¬LH0,35¬FS'
           O          E            bclabel     1
           o                                              '¬LL1350¬PW900'
           O          E            bclabel     1
           o                                              '¬MD5'
           O          E            bclabel     1
           o                                              '¬MNN'
           O          E            bclabel     1
           o                                              '¬FWr'
           O          E            bclabel     1
           o                                              '¬CFr45,25¬FS'
           O          E            bclabel     1
           o                                              '¬FO665,0¬a0¬FN10¬FS'
           o                                              '¬FO665,75¬Fn20¬FS'
           o                                              '¬FO665,260¬FN30¬FS'
           o                                              '¬FO665,360¬Fn40¬FS'
           o                                              '¬FO665,600¬FN50¬FS'
           o                                              '¬FO665,660¬FN60¬FS'
           o                                              '¬FO665,710¬FN70¬FS'
           o                                              '¬FO665,735¬Fn80¬FS'
           O          E            bclabel     1
           o                                              '¬FO595,0¬FN90¬FS'
           o                                              '¬FO595,75¬Fn100¬FS'
           o                                              '¬FO595,260¬FN110¬FS'
           o                                              '¬FO595,310¬Fn120¬FS'
           o                                              '¬FO595,600¬FN130¬FS'
           o                                              '¬FO595,660¬Fn140¬FS'
           O          E            bclabel     1
           o                                              '¬FO525,0¬FN150¬FS'
           o                                              '¬FO525,600¬FN160¬FS'
           o                                              '¬FO525,660¬FN170¬FS'
           O          E            bclabel     1
           o                                              '¬FO455,0¬FN180¬FS'
           o                                              '¬FO455,160¬FN190¬FS'
           o                                              '¬FO455,600¬FN200¬FS'
           o                                              '¬FO455,720¬FN210¬FS'
           O          E            bclabel     1
           o                                              '¬FO315,0¬Ar,140,180'
           o                                              '¬FN230¬FS'
           O          E            bclabel     1
           o                                              '¬FO280,130¬FN250¬FS'
           O          E            bclabel     1
           o                                              '¬FO210,0¬FN240¬FS'
           o                                              '¬FO210,150¬FN260¬FS'
           O          E            bclabel     1
           o                                              '¬FO140,0¬FN270¬FS'
           o                                              '¬FO140,190¬FN280¬FS'
           o                                              '¬FO140,360¬FN290¬FS'
           O          E            bclabel     1
           o                                              '¬FO70,0¬FN300¬FS'
           o                                              '¬FO70,90¬FN310¬FS'
      a003 o                                              '¬FO70,150¬FN330¬FS'
      a003 o                                              '¬FO70,240¬FN340¬FS'
           o                                              '¬FO100,450¬A0'
           o                                              '¬BCR,150,Y,N¬FN320¬FS'
           O          E            bclabel     1
           o                                              '¬XZ'
            *
            * Define the fields
           O          E            bclabel     1
           o                                              '¬XA'
           o                                              '¬XFPM010.ZPL¬FS'
            *
           O          E            bclabel     1
           o                                              '¬FN70¬FDv.¬FS'
           o                                              '¬FN10¬FDWes:¬FS'
           O                                              '¬FN20¬FD'
           o                       $grno09
           o                                              '¬FS'
           o                                              '¬FN30¬FDDatum:¬FS'
           O                                              '¬Fn40¬FD'
           o                       $RECDMY
           o                                              '¬FS'
           o                                              '¬FN50¬FDAnz:¬FS'
           O                                              '¬FN60¬FD'
           o                       $x1
           o                                              '¬FS'
           O                                              '¬FN80¬FD'
           o                       $LABELS
           o                                              '¬FS'
            *
           O          E            bclabel     1
           o                                              '¬FN90¬FDLief:¬FS'
           O                                              '¬FN100¬FV'
           o                       VNDR09
           o                                              '¬FS'
           o                                              '¬FN110¬FDLS:¬FS'
           O                                              '¬FN120¬FV'
           o                       ADVN09
           o                                              '¬FS'
           o                                              '¬FN130¬FDRef:¬FS'
           O                                              '¬FN140¬FV'
           o                       TREX09
           o                                              '¬FS'
            *
           O          E            bclabel     1
           O                                              '¬FN150¬FD'
           o                       SNAM05
           o                                              '¬FS'
           o                                              '¬FN160¬FDBN:¬FS'
           O                                              '¬FN170¬FD'
           o                       ORDN09
           o                                              '¬FS'
            *
           O          E            bclabel     1
           o                                              '¬FN180¬FDNachw. Ref:¬FS'
           O                                              '¬FN190¬FD'
           o                       TRIN09
           o                                              '¬FS'
           o                                              '¬FN200¬FDVerf. Dat:¬FS'
           O                                              '¬FN210¬FD'
           o                       $EXPD
           o                                              '¬FS'
            *
           O          E            bclabel     1
           O               55                             '¬FN230¬FD'
           o               55      ITEM09
           o               55                             '¬FS'
            *
           O          E            bclabel     1
           o                                              '¬FN240¬FDNr. LfrnKat:¬FS'
           o               55                             '¬FN250¬FD'
           o               55      PDESCC
           o               55                             '¬FS'
           o                                              '¬FN260¬FD'
           o                       VCAT09
           o                                              '¬FS'
            *
           O          E            bclabel     1
           o                                              '¬FN270¬FDGesamt Menge:¬FS'
           o                                              '¬FN280¬FD'
           o                       $QTYR
           o                                              '¬FS'
           o                                              '¬FN290¬FD'
           o                       RUOM
           o                                              '¬FS'
            *
           O          E            bclabel     1
           o               55                             '¬FN300¬FDLager:¬FS'
           o               55                             '¬FN310¬FD'
           o               55      WHSEP1
           o               55                             '¬FS'
      a003 o                                              '¬FN330¬FD'
      a003 o                       BNO160
      a003 o                                              '¬FS'
      a003 o                                              '¬FN340¬FD'
      a003 o                       BNO260
      a003 o                                              '¬FS'
           O                                              '¬FN320¬FD'
           o                       ITEM09
           o                                              '¬FS'
           O          E            bclabel     1
           o                                              '¬XZ'
            *
            * reset printer
           O          E            bclabel     1
           o                                              '¬XA'
           O          E            bclabel     1
           o                                              '¬LL100'
           O          E            bclabel     1
           o                                              '¬FWn¬FS'
           o                                              '¬CFr45,25¬FS'
           O          E            bclabel     1
      a002eo                                              '¬XZ'
      Regards

      Kit
      http://www.ecofitonline.com
      DeskfIT - ChangefIT - XrefIT
      ___________________________________
      There are only 3 kinds of people -
      Those that can count and those that can't.

      Comment


      • #4
        Re: Printing BarCodes on ZEBRA Printer using RPG

        added the manuals I used at the time. I don't know if u have them (or have newer versions).
        Attached Files
        Regards

        Kit
        http://www.ecofitonline.com
        DeskfIT - ChangefIT - XrefIT
        ___________________________________
        There are only 3 kinds of people -
        Those that can count and those that can't.

        Comment


        • #5
          Re: Printing BarCodes on ZEBRA Printer using RPG

          ufff... my walkingman.gif stopped walking.
          Regards

          Kit
          http://www.ecofitonline.com
          DeskfIT - ChangefIT - XrefIT
          ___________________________________
          There are only 3 kinds of people -
          Those that can count and those that can't.

          Comment


          • #6
            Re: Printing BarCodes on ZEBRA Printer using RPG

            In the code below replace the '¬' with '^'. (Caused by ccsid of my job)
            Regards

            Kit
            http://www.ecofitonline.com
            DeskfIT - ChangefIT - XrefIT
            ___________________________________
            There are only 3 kinds of people -
            Those that can count and those that can't.

            Comment


            • #7
              Re: Printing BarCodes on ZEBRA Printer using RPG

              That's the way I do it. It's also much easyer to change "redesign" the label, than to code it the hard way all in dds!


              1) generate with the software that came with your Zebra Printer a label.

              Print it to file. ( = a file to your desktop)
              Then rename it: #EPLLABEL (with no file extention)

              2) transfer this file ( #EPLLABEL ) to the AS400.

              3) code DDS and RPG program

              The DDS is only 2 lines !

              DDS BRCODP
              Code:
              A*-------------------------------------------------------------------------
              A          R PRINTLINE                 SPACEA(1)                           
              A            EPLLINE       80A        1TEXT('EPL LINE')
              RPG BRCOD ( read flatfile #EPLLABEL line for line and print out)

              Code:
              F#EPLLABEL IF   F  108        DISK                                         
              FBRCODP    O    E             PRINTER USROPN                                        
              F                                     OFLIND(*IN80)    
              
              D** define your fields here
              
              ** Define recordformat #EPLLABEL                            
              I#EPLLABEL ns  01                                    
              I                                  1  108  EPLDATA  
              
              C                   OPEN      BRCODP
              C                   READ      #EPLLABEL                                    
              C                   DOW       NOT %EOF                                                   
              C                   EVAL      EPLLINE = %TRIM(EPLDATA)     
               
              ** do something here (see code below )
              
              ** we do not want overflow, so we reset before we print  
              C   80              SETOFF                                       80
              C                   WRITE     PRINTLINE                                   
              
              C                   READ      #EPLLABEL                                                    
              C                   ENDDO 
              C                   CLOSE     BRCODP
              
              C                   SETON                                        LR          
              C                   RETURN
              Note: if you generated a 12 digit barcode with the number '12345678912'
              it's easy to replace it with the number you want to pint )
              note: in this example I coded barcodenr as a char 12A !

              ** do something here example

              Code:
              **************************************************       
              D 1stchar         S              1A
              D pos             S              3  0
              D barcodenr       S             12A  
              
              **************************************************    
              ** test if we print a "Barcode"   
              ** get 1stchar                                                        
              C                   EVAL      1stchar = %subst(EPLLINE:1:1)                     
              ** 1stchar 'B' = barcode    
              C                   IF        1stchar = 'B'                                  
              C                   EVAL      pos = %scan('123456789012':EPLLINE)  
                                        
              ** replace the 12 digits with your barcodenumber
              ** -------------------------------------------------------------
              C                   EVAL      barcodenr = '210987654321'
              ** -------------------------------------------------------------
              C                   IF        pos > 0                                                         
              C                   EVAL      EPLLINE= %replace(barcodenr                                         
              C                             :EPLLINE:pos:12)                                                                                                                                                                                                      
              C                   ENDIF                                                                     
              C                   ENDIF                                                                     
              **************************************************
              You could this way replace the codes what need to bee variable in every line with your data.
              For Example:
              I generete a variabel textfield with the text TXT1

              the EPL code would look something like
              A63,593,3,4,1,1,N,"TXT1"

              When I read the EPLLINE I replace TXT1 with for example a DB-field Customer)

              Code:
              C                   EVAL      pos = %scan( 'TXT1' : EPLLINE)        
              C                   IF        pos > 0    
              .. code the replace here
              If you want to print more than 1 label , replace last line
              P1
              with the number of labels you want to print
              P<number>
              so,
              P3
              prints 3 labels on your Zebra printer

              Keep Walking !
              Last edited by Marc_d; June 25, 2008, 05:50 AM. Reason: Changed ZPL to EPL to avoid confusion about ZPL and EPL

              Comment


              • #8
                Re: Printing BarCodes on ZEBRA Printer using RPG

                Just a Note: I use EPL code for printing on your ZEBRA TLP 2844

                EPL2 Programmer?s
                Manual
                download site:



                ZEBRA EPL COMPATIBLE PRINTERS

                * 2746e
                * LP 2824
                * LP 2844
                * PS 2122
                * QL 220 Plus
                * QL 320 Plus
                * QL 420 Plus
                * S4M
                * TLP 2824
                * TLP 2844
                * TLP 3842
                * TR 220

                Other Zebra manuals download

                A world leader in innovative digital solutions, hardware and software, Zebra enables businesses of all sizes to intelligently connect data, assets, and people.

                Comment


                • #9
                  Re: Printing BarCodes on ZEBRA Printer using RPG

                  kit -- send me the full size working image and I'll make it work for you.
                  All my answers were extracted from the "Big Dummy's Guide to the As400"
                  and I take no responsibility for any of them.

                  www.code400.com

                  Comment


                  • #10
                    Re: Printing BarCodes on ZEBRA Printer using RPG

                    It's a no brainer. Use TL Ashford software to design the label in about 5 minutes. (yup that quick). Then just do a call to the zebra label printing program passing the data. BANG...one label or many depending on the copies required.

                    TLA software is not expensive and it will save you that much in labor saving costs the first week you use it.

                    If you code the label in your DDS or RPG program it will take you hours upon hours to lay it our properly using trial and error, print/change...print/change....

                    I can literally design a bar code label in less than 5 minutes using TLA gui designer.

                    IMHO
                    Oh and BTW I can also sell you the software and hardware (shameful plug), if interested.
                    Last edited by Billw; June 25, 2008, 08:02 AM.
                    Bill
                    "A good friend will bail you out of jail,
                    A true friend would be sitting beside you saying,
                    'Wow, that was fun.'"

                    Comment


                    • #11
                      Re: Printing BarCodes on ZEBRA Printer using RPG

                      Originally posted by Billw View Post
                      It's a no brainer. Use TL Ashford software to design the label in about 5 minutes. (yup that quick). Then just do a call to the zebra label printing program passing the data. BANG...one label or many depending on the copies required.

                      TLA software is not expensive and it will save you that much in labor saving costs the first week you use it.

                      If you code the label in your DDS or RPG program it will take you hours upon hours to lay it our properly using trial and error, print/change...print/change....

                      I can literally design a bar code label in less than 5 minutes using TLA gui designer.

                      IMHO
                      Oh and BTW I can also sell you the software and hardware (shameful plug), if interested.
                      Ok, riddle me this:

                      I have TLA 3.0 and a Zebra 140XiIII.

                      Yesterday I designed a new label and am trying to use the arial narrow font - which is not built into the printer but the manual says it can be downloaded.

                      I've run the following command, and "something" is sent to my printer as the light flashes for about 30 seconds.

                      Z4XIFONTDL OUTQ(FGMZEBRA) FNTID(ARIALN) MEMLOC(E)

                      After which, I try to print one of my new labels and the font's printed are not Arial Narrow.

                      I've been pulling my hair out for a day and a half now.

                      Comment


                      • #12
                        Re: Printing BarCodes on ZEBRA Printer using RPG

                        Can you watch the front of the printer as the light flashes? What does it say?
                        "Out of Memory Storing Font".
                        Bill
                        "A good friend will bail you out of jail,
                        A true friend would be sitting beside you saying,
                        'Wow, that was fun.'"

                        Comment


                        • #13
                          Re: Printing BarCodes on ZEBRA Printer using RPG

                          Originally posted by Billw View Post
                          Can you watch the front of the printer as the light flashes? What does it say?
                          "Out of Memory Storing Font".
                          The light flashes for about 45 seconds and the display never changes. It says this the entire time:

                          Printer Ready
                          4.0MB V33.10.4

                          It's hooked up to my PC and I have a Client Access session running to make it an AS/400 printer. The printer is set up in Windows as a generic printer.

                          It prints other labels just fine, although I don't know if our other formats use ArialN as they were designed by my predecessor.

                          Comment


                          • #14
                            Re: Printing BarCodes on ZEBRA Printer using RPG

                            I tried just that on one yesterday and it said Out of memory.

                            Your best bet is call TLA support through:



                            or at 1-800-541-4893
                            Bill
                            "A good friend will bail you out of jail,
                            A true friend would be sitting beside you saying,
                            'Wow, that was fun.'"

                            Comment


                            • #15
                              Re: Printing BarCodes on ZEBRA Printer using RPG

                              I was able to load *ALL to a zebra ZM400 it submitted
                              (I think 6 jobs) They all ran fine....
                              see list of the loaded fonts:
                              I would guess hardware related
                              Attached Files
                              I'm here to chew bubble gum and kick @#%@#%@#%.....and I'm all outta bubble gum !
                              Yes I'm talking to you squirrel nuts.

                              Comment

                              Working...
                              X