print to zebra from rpg
Last Post 12 Aug 2010 05:48 PM by Marcia Dore. 14 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
Larisa Gasparian
New Member
New Member
Posts:3

--
10 Aug 2010 07:06 PM
Hi all. I need to print existing RPG program to Zebra Label Printer. I connected printer to AS/400 via IP, created Zebra outq, downloaded ZPL file, but I don't know how to embed this file to my program. Thank you for help.
Richard Schoen
New Member
New Member
Posts:40

--
10 Aug 2010 07:17 PM Accepted Answer
If it's a ZPL file you should be able to send the ZPL to a spool file and out to the printer. Check the following. Google is your friend. http://www.code400.com/forum/showth...-using-RPG Regards, Richard Schoen RJS Software Systems Inc. Where Information Meets Innovation Document Management, Workflow, Report Delivery, Forms and Business Intelligence Email: richard@rjssoftware.com Web Site: http://www.rjssoftware.com Tel: (952) 736-5800 Fax: (952) 736-5801 Toll Free: (888) RJSSOFT
Larisa Gasparian
New Member
New Member
Posts:3

--
10 Aug 2010 07:33 PM Accepted Answer
Hi, I did search google, you send me a link to print barcodes, I need only to print simple address labels. Thanl you.
Scott Klement
Editorial Staff Member
Editorial Staff Member
Posts:16345
Avatar

--
10 Aug 2010 07:53 PM Accepted Answer
Hi all. I need to print existing RPG program to Zebra Label Printer.
Typically (at least in my experience) you'd re-write the output in the RPG program to generate the appropriate ZPL codes. Are you saying you need this to work without any changes to the RPG?
I connected printer to AS/400 via IP, created Zebra outq, downloaded ZPL file, but I don't know how to embed this file to my program
What do you mean by "downloaded ZPL file" and "embed this file in my RPG program"? What is a ZPL file? Is this a WSCST source provided by Zebra? Or is it the actual raw ZPL codes to send to the printer? (In which case, it's an EXAMPLE, not something you can embed in your program -- it's to give you an example of which codes to send, so you can modify your RPG program accordingly.) Or is this a Windows printer driver? (In which case, it's not going to be useful for printing from the "AS/400" [SIC]) Please give more information about the ZPL file?
Larisa Gasparian
New Member
New Member
Posts:3

--
10 Aug 2010 08:03 PM Accepted Answer
Thank you. I think it is just raw file sent to the printer, another programer referenced it to me. Ideally, i would just send existing program to the Zebra printer. That is where I am lost. Thank you again.
Rocky Marquiss
Senior Member
Senior Member
Posts:2906

--
10 Aug 2010 09:33 PM Accepted Answer
Hi all. I need to print existing RPG program to Zebra Label Printer. I connected printer to AS/400 via IP, created Zebra outq, downloaded ZPL file, but I don't know how to embed this file to my program. Thank you for help.
We have some software called BARCODE400 from TL Ashford for this purpose - makes for much easier programming.
Scott Klement
Editorial Staff Member
Editorial Staff Member
Posts:16345
Avatar

--
11 Aug 2010 01:03 AM Accepted Answer
If you just want to send a raw file, then read the file into your RPG program using the IFS APIs, and write it out to a *USERASCII spooled file. There's a sample program here: http://www.pentontech.com/IBMConten...rtStmf.zip However, I don't see how that'll help you print address labels, unless someone pre-generates them for you and puts them into a ZPL encoded stream file.
Marcia Dore
Veteran Member
Veteran Member
Posts:546

--
11 Aug 2010 12:04 PM Accepted Answer
Hi, I did search google, you send me a link to print barcodes, I need only to print simple address labels. Thanl you.
You still need to use the zpl language around it - even if you are not printing barcodes - you need to tell it the font and position of every line on the label. If you are only printing one set of labels - using the imbedded ZPL language should work for you. If you are going to be printing many different types of labels - I agree with Rocky - using TLASHFORD Barcode400 is less painful & supports many types of printers (so if your company changes printers - you do not have to recode RPG programs).
Paul Myers
Basic Member
Basic Member
Posts:188
Avatar

--
11 Aug 2010 12:22 PM Accepted Answer
Here is a very basic example of an RPG program printing a label. I'm not sure what printer the control codes are for but you may get the idea and be able to substitute your Zebra codes. The label printer is defined to the AS/400 as a plain text printer. You can experiment by defining the printer to a PC as a text only printer and sending a notepad file to it containing the same output as you are preparing from your RPG. Printfile - compiled with normal *SCS defaults

fLS402PT   O    E             PRINTER INFSR(*PSSR)                          
f                                     USROPN                                
f                                     OFLIND(*IN01)                         
fPARTS     IF   E           K DISK    INFSR(*PSSR)                          
FLSP00     IF   E           K DISK    INFSR(*PSSR)                          
FLSP04     IF   E           K DISK    INFSR(*PSSR)                          
f************************************************************************** 
                                                                            
d************************************************************************** 
d LS402           PR                                                        
d   p#PNUM                      15A                                         
d   p#UREF                       8A                                         
d   p#DATE                       6  0                                       
d   p#QTY                       11  0                                       
                                                                            
d LS402           PI                                                        
d   p#PNUM                      15A                                        
d   p#UREF                       8A                                        
d   p#DATE                       6  0                                      
d   p#QTY                       11  0                                      
                                                                           
d @ovr            S              1    inz('0')                             
d QCmdCmd         S           1024                                         
d QCmdLength      S             15  5 INZ(%size(QCmdCmd))                  
                                                                           
d LIN             S            100    DIM(33) CTDATA PERRCD(1)             
d LDA           E DS                  EXTNAME(LDA)                         
d PSTAT         ESDS                  EXTNAME(PSDS)                        
d**************************************************************************
                                                                           
c**************************************************************************
c     k35in         Klist                                                  
c                   Kfld                    L#CONO                         
c                   Kfld                    PNUM35                         
c     k04ls         Klist                                                  
c                   Kfld                    L#CONO                         
c                   Kfld                    L#USER                             
c     k00ls         Klist                                                      
c                   Kfld                    L#CONO                             
c                   Kfld                    STRC04                             
                                                                               
c     *DTAARA       Define    *LDA          LDA                                
c                   In        LDA                                              
                                                                               
c     k04ls         Chain     LSP04                                            
c     k00ls         Chain     LSP00                                            
                                                                               
c* Override to user outq if set up                                             
c     GILQ04        Ifne      *blanks                                          
c     GILL04        Andne     *blanks                                          
c*                                                                             
c                   eval      QCmdCmd = 'OVRPRTF FILE(LS402PT) ' +             
c                                       'OUTQ('+%trim(GILL04)+'/'+             
c                                       %trim(GILQ04)+') +                     
c                                       SECURE(*YES)'                          
c                   call      'QCMDEXC'                                        
c                   parm                    QCmdCmd                    
c                   parm                    QCmdLength                 
c                   Eval      @ovr = *on                               
c*                                                                     
c                   Else                                               
c*                                                                     
c* Override to stockroom outq if set up                                
c     GILQ00        Ifne      *blanks                                  
c     GILL00        Andne     *blanks                                  
c*                                                                     
c                   eval      QCmdCmd = 'OVRPRTF FILE(LS402PT) ' +     
c                                       'OUTQ('+%trim(GILL00)+'/'+     
c                                       %trim(GILQ00)+') +             
c                                       SECURE(*YES)'                  
c                   call      'QCMDEXC'                                
c                   parm                    QCmdCmd                    
c                   parm                    QCmdLength                 
c                   Eval      @ovr = *on                               
c*                                                                     
c                   Endif                                              
c                   Endif                                                                   
c*                                                                                          
                                                                                            
c                   Eval      PNUM35 = p#PNUM                                               
c     k35in         Chain     PARTS                                                         
                                                                                            
c                   Eval      LINE01 = LIN(1)                                               
c                   Eval      LINE02 = LIN(2)                                               
c                   Eval      LINE03 = LIN(3)                                               
c                   Eval      LINE04 = LIN(4)                                               
c                   Eval      LINE05 = LIN(5)                                               
c                   Eval      LINE06 = LIN(6)                                               
c                   Eval      LINE07 = %trim(LIN(7))+%trim(PNUM35)+';<ETX>'Item code        
c                   Eval      LINE08 = LIN(8)                                               
c                   Eval      LINE09 = %trim(LIN(9))+%trim(PDES35)+';<ETX>'Item description 
c                   Eval      LINE10 = LIN(10)                                              
c                   Eval      LINE11 = %trim(LIN(11)) +                                     
c                                      %trim(%editc(p#QTY:'Z')) + '<ETX>'  Quantity         
c                   Eval      LINE12 = %trim(LIN(12)) +                                     
c                                      %trim(%editc(p#QTY:'Z')) + ';<ETX>' Quantity         
c                   Eval      LINE13 = LIN(13)                                        
c                   Eval      LINE14 = %trim(LIN(14))+%trim(PNUM35)+'<ETX>'Barcode    
c                   Eval      LINE15 = LIN(15)                                        
c                   Eval      LINE16 =%trim(LIN(16))+%trim(p#UREF)+'<ETX>' Reference  
c                   Eval      LINE17 =%trim(LIN(17))+%trim(p#UREF)+';<ETX>'Reference  
c                   Eval      LINE18 = LIN(18)                                        
c                   Eval      LINE19 = %trim(LIN(19)) +                               
c                                      %trim(%editc(p#DATE:'Y')) + '<ETX>' Date       
c                   Eval      LINE20 = LIN(20)                                        
c                   Eval      LINE21 = LIN(21)                                        
c                   Eval      LINE22 = LIN(22)                                        
c                   Eval      LINE23 = LIN(23)                                        
c                   Eval      LINE24 = LIN(24)                                        
c                   Eval      LINE25 = LIN(25)                                        
c                   Eval      LINE26 = LIN(26)                                        
c                   Eval      LINE27 = LIN(27)                                        
c                   Eval      LINE28 = LIN(28)                                        
c                   Eval      LINE29 = LIN(29)                                        
c                   Eval      LINE30 = LIN(30)                                        
c                   Eval      LINE31 = LIN(31)                                        
c                   Eval      LINE32 = LIN(32)                              
c                   Eval      LINE33 = LIN(33)                              
c                   Open      LS402PT                                       
c                   Write     LABELR                                        
c                   Close     LS402PT                                       
c     @ovr          Ifeq      *on                                           
c                   eval      QCmdCmd = 'DLTOVR  FILE(LS402PT) '            
c                   call      'QCMDEXC'                                     
c                   parm                    QCmdCmd                         
c                   parm                    QCmdLength                      
c                   Endif                                                   
                                                                            
c                   Eval      *inlr = *on                                   
**                                                             
<STX><SI>F5<ETX>                                               
<STX><ESC>C<ETX>                                               
<STX><ESC>P<ETX>                                               
<STX>E3;F3;<ETX>                                               
<STX>W1;o80,80;l1440;h1100;w3;<ETX>                            
<STX>H2;o110, 100;f0;c34;h2;w2;d3,ITEM:;<ETX>                  
<STX>H3;o650, 90;f0;c34;h3;w3;d3,                              
<STX>H4;o110, 220;f0;c34;h2;w2;d3,DESCRIPTION:;<ETX>           
<STX>H5;o650,240;f0;c34;h1;w1;d3,                              
<STX>H6;o110, 420;f0;c34;h2;w2;d3,QUANTITY:;<ETX>              
<STX>B7;o650,360;f0;c6,0;h160;w4;i0;d3,                        
<STX>H8;o1200,420;f0;c34;h3;w3;d3,                             
<STX>H9;o110,660;f0;c34;h2;w2;d3,ITEM:;<ETX>                   
<STX>B10;o650,580;f0;c6,0;h160;w4;i0;d3,                       
<STX>H12;o110,820;f0;c34;h2;w2;d3,REFERENCE:;<ETX>             
<STX>B13;o650,800;f0;c6,0;h160;w4;i0;d3,                       
<STX>H14;o1140,820;f0;c34;h2;w2;d3,                            
<STX>H15;o110,990;f0;c34;h2;w2;d3,RECEIPT DATE;<ETX>           
<STX>H16;o650,990;f0;c34;h2;w2;d3,                             
<STX>H17;o110,1090;f0;c34;h2;w2;d3,BATCH NO:;<ETX>         
<STX>L18;o80,200;f0;l1440;w2;<ETX>                         
<STX>L19;o80,330;f0;l1440;w2;<ETX>                         
<STX>L20;o80,550;f0;l1440;w2;<ETX>                         
<STX>L21;o80,770;f0;l1440;w2;<ETX>                         
<STX>L22;o80,990;f0;l1440;w2;<ETX>                         
<STX>L23;o80,1080;f0;l1440;w2;<ETX>                        
<STX>L24;o600, 80;f3;l1100;w3;<ETX>                        
<STX>R<ETX>                                                
<STX><ESC>E3,1<CAN><ETX>                                   
<STX><RS>001<ETX>                                          
<STX><US>1<ETX>                                            
<STX><ETB><ETX>                                            
<STX><FF><ETX>    
Paul Myers
Basic Member
Basic Member
Posts:188
Avatar

--
11 Aug 2010 12:37 PM Accepted Answer
Actually I would have thought the link posted by rjssoft would give you all you need. The barcodes are an added bonus!
Scott Klement
Editorial Staff Member
Editorial Staff Member
Posts:16345
Avatar

--
11 Aug 2010 01:48 PM Accepted Answer
Good grief, Paul... the , , , etc aren't meant to be printed literally. If I told you to press on your keyboard, you wouldn't type <, then E, then N, then T, then E, then R, then >, would you? The actual ENTER key doesn't produce a printable result on the screen, so I have to refer to it as so you know to press the key rather than type out the actual letters. The same is true of , , and . You don't type those literally -- they represent unprintable character codes ("escape sequences") that you have to send to the printer. Unfortunately, since your RPG program is in EBCDIC, and the printer program is in ASCII, you can't simply insert the hex codes that correspond to , et al. Including these unprintable characters requires special considerations.... I'm not even sure that and exist in EBCDIC. You could have all sorts of fun trying to get these to work. That's why I suggested using *USERASCII. (You could also use the SCS transparency code with RPLUNPRT(*NO)) I agree with the others that TL Ashford's software would simplify this. But I also don't want to give the impression that this can't be done in RPG directly! Using a software package like TL Ashford does a lot of the work for you, but if you're only doing simple address labels once, then perhaps it's overkill. And it's not what the OP asked for.
Rocky Marquiss
Senior Member
Senior Member
Posts:2906

--
11 Aug 2010 02:40 PM Accepted Answer
Barcode400 from TL Ashford makes this whole process so much easier - standard RPG code - no need to worry about escape sequences yada yada yada... the time spent on figuring this out and creating the program would likely pay the price of the software.
Dan Devoe
Advanced Member
Advanced Member
Posts:465

--
11 Aug 2010 03:09 PM Accepted Answer
I have used T.L.Ashford's BarCode/400 for many years. Their software is very reasonably priced, and they have great tech support. A few years back, I was given a contract "side job", by a former co-worker, to develop a software package for them (which resulted in them buying a 400). One of their big concerns was printing labels to a Zebra printer. During one of our proof-of-concept meetings, I demonstrated to them how easily we could print labels. They instructed me to contact T.L.Ashford & get pricing. At my current job, we're using Cybra's MarkMagic. I haven't played with it, so I can't legitimately compare it to BarCode/400.
Paul Myers
Basic Member
Basic Member
Posts:188
Avatar

--
12 Aug 2010 08:22 AM Accepted Answer
Good grief, Paul... the , , , etc aren't meant to be printed literally. If I told you to press on your keyboard, you wouldn't type <, then E, then N, then T, then E, then R, then >, would you? The actual ENTER key doesn't produce a printable result on the screen, so I have to refer to it as so you know to press the key rather than type out the actual letters. The same is true of , , and . You don't type those literally -- they represent unprintable character codes ("escape sequences") that you have to send to the printer. Unfortunately, since your RPG program is in EBCDIC, and the printer program is in ASCII, you can't simply insert the hex codes that correspond to , et al. Including these unprintable characters requires special considerations.... I'm not even sure that and exist in EBCDIC. You could have all sorts of fun trying to get these to work. That's why I suggested using *USERASCII. (You could also use the SCS transparency code with RPLUNPRT(*NO)) I agree with the others that TL Ashford's software would simplify this. But I also don't want to give the impression that this can't be done in RPG directly! Using a software package like TL Ashford does a lot of the work for you, but if you're only doing simple address labels once, then perhaps it's overkill. And it's not what the OP asked for.
I haven't got a clue how it translates these Scott. The program was originally written by a company claiming to specialize in printing labels back in 1995 or there abouts. I just keep copying it whenever the customer needs a new label and setting up any new printers in the same way and it keeps on doing the job.
Marcia Dore
Veteran Member
Veteran Member
Posts:546

--
12 Aug 2010 05:48 PM Accepted Answer
At my current job, we're using Cybra's MarkMagic. I haven't played with it, so I can't legitimately compare it to BarCode/400.
BarCode/400 has both a better GUI interface and a better 5250 interface. It's direct call is also easier to add to an RPG program. (And its RFID barcode is easy to set up).
You are not authorized to post a reply.

Acceptable Use Policy