ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Printing Barcode on Wipro and Epson Printers or on HP Printers using RPG, CL

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

  • Printing Barcode on Wipro and Epson Printers or on HP Printers using RPG, CL

    Hi All,

    I am using LQ5400+(Wipro Make) and LX-800 (Epson Make) printers in my store. I have been using Mapics on AS400. To use Barcode, initially my factory used a software may be written in VB. This software is not linked to my AS400..

    Now, I want to write a program on Barcode in AS400 so that the inventory files in AS400 box gets updated with the barcode data. Can any one help me. I have read the topic on Printing BarCodes on ZEBRA Printer using RPG which is very helpful but I would like to do printing Barcode on Wipro and Epson Printer (Models mentioned above) using RPG and CL.. If possible on HP printers then also please let me know. Help me with some code..

    Thank you very much in advance.

  • #2
    Re: Printing Barcode on Wipro and Epson Printers or on HP Printers using RPG, CL

    To get you started ! Use it as a startpoint ! It's not the solution !

    I am sure you can covert it for printing barcodes on an epson matrix printer !


    For an CL and RPGLE example # print and cut the receipt and kick the cash drawer # look at the end !

    Epson barcode build-in You could convert these Old code written in Basic for EPSON matrix.

    Tip: Use in your DDS the TRNSPY keyword ! http://www.itjungle.com/mgo/mgo072503-story01.html


    Read the epson guide: see chapter C12 -> C15 for more info about escape codes



    Example 1 (old basic)


    OPEN "com1:9600,n,8,1,cd0,cs0,ds3000" FOR RANDOM AS #1

    lf$ = CHR$(&HA)
    esc$ = CHR$(&H1B)
    gs$ = CHR$(&H1D)
    us$ = CHR$(&H1F)
    cr$ = CHR$(&HD)
    ff$ = CHR$(&HC)

    PRINT #1, esc$; "@";
    PRINT #1, CHR$(&HA); CHR$(&HA)
    REM select HRI font size
    PRINT #1, gs$; "f"; CHR$(1)
    REM print HRI character below the barcode
    PRINT #1, gs$; "H"; CHR$(2)
    REM print barcode CODE39 with 15 Digits
    REM set width. Due to the width of the label this is set to 1
    PRINT #1, gs$; "w"; CHR$(1);
    REM set barcode hieght in dots
    PRINT #1, gs$; "h"; CHR$(50);
    REM Print Barcode; GS; k ,69 for CODE39 15 is the length of the data. ie 15 numbers.
    PRINT #1, gs$; "k"; CHR$(69); CHR$(15);
    REM Barcode data
    PRINT #1, "123456789112345";
    PRINT #1, CHR$(&HA);
    PRINT #1, CHR$(&HD)

    Example 2 (old basic)

    OPEN "com1:9600,n,8,1,cd0,cs0,ds3000" FOR RANDOM AS #1

    lf$ = CHR$(&HA)
    esc$ = CHR$(&H1B)
    gs$ = CHR$(&H1D)
    us$ = CHR$(&H1F)
    cr$ = CHR$(&HD)
    ff$ = CHR$(&HC)

    PRINT #1, esc$; "@";
    PRINT #1, CHR$(&HA); CHR$(&HA)
    REM select HRI font size
    PRINT #1, gs$; "f"; CHR$(2)
    REM print HRI character below the barcode
    PRINT #1, gs$; "H"; CHR$(2)
    REM set width.
    PRINT #1, gs$; "w"; CHR$(3);
    REM set barcode hieght in dots
    PRINT #1, gs$; "h"; CHR$(100);
    REM PRINT CODE128 using CODE B No. and CODE C for 12345
    PRINT #1, gs$; "k"; CHR$(73); CHR$(10); CHR$(123); CHR$(66); CHR$(78); CHR$(111); CHR$(46); CHR$(123); CHR$(67); CHR$(12); CHR$(34); CHR$(56);
    PRINT #1, CHR$(&HA);
    PRINT #1, CHR$(&HD)

    For an RPGLE example:



    And the CL for the printer configuration

    Comment

    Working...
    X