Unconfigured Ad Widget



No announcement yet.

QR Barcode Printing using RPG and DDS - tech tip

  • Filter
  • Time
  • Show
Clear All
new posts

  • QR Barcode Printing using RPG and DDS - tech tip

    We're going to use tablets on the shopfloor and need a barcode that will scan quickly and easily. The QR Quick Response barcodes are the way to go we feel. I needed to print this barcode instead of 3of9 on shop floor kanban tags generated via AFP printfile.

    IBM added QR barcode support in 6.1 per apar SE49578. However I could not find information on how to use it. I finally contacted IBM and received information on how to use it. I used the code example and print just normal characters got it working right away. Note that IBM says this is unsupported and use as is.

    Our Subject Matter Expert for Print advised:

    What kind of printer are they printing to? This is a newer barcode for which HPT has support, but most IPDS printers do not. Infoprint Server , which emulates an IPDS printer does not have support.

    We don't have DDS support for QRCODE. You can code up the BARCODE keyword using generic barcode id's, if the barcode has been architected, but for which we haven't added DDS support. The problem is: QR code is a 2D barcode for which you have to code up special QR code "stuff". When you use DDS with other 2D barcodes, such as MAXICODE, PDF417, we have DDS support for their special condtions. Since we don't have support for QR code, the customer would have to know the architecture, and then code up the special "stuff" themselves. Another problem, since we don't have DDS support; is that the data to be barcoded needs to be in code page 500. Normally, our DDS support will automatically translate to 500. Since we won't be doing that, the customer would have to ensure the data is correct for code page 500. If they are just coding up 0-9, A-Z characters, they probably don't have to worry about it.

    I will post an example, written in RPGLE, which is "as-is" and unsupported. Since we don't have official support, getting it to work to their specifications would require a consultant.

    Code page 500 layout, and the code page 37, which is what most US customers use, so that they can see if the characters are the same value in both code pages.


    Barcode architecture document, which would give more info on the layout of the special QR code data that must be sent prepended to the actual data to be barcoded:

    * Printer File QRCODE was compiled with this record. The *WIDTH will control
    * the size. (*WIDTH 0.12) will make a very large barcode.
    * R RECORD1
    * FIELD1 29 12 12BARCODE(32 X'02' (*WIDTH 0.007))
    * The printer file must be created using DEVTYPE(*AFPDS) and RPLUNPRT(*NO).
    * Define the QR Code special function parameters. Refer to BCOCA
    * specification manual for more information. Note that the data to
    * be barcoded must be in code page 500. For the other 2D barcode types,
    * the operating system converts the data you barcode to code page 500
    * before writing it to the spooled file. The operating system does not
    * have true DDS support for QR Code, so the user will have to ensure that
    * the data to be barcoded is already in code page 500.
    DFN DS
    DFN5 1 1
    DFN6 2 2
    DFN7 3 3
    DFN8 4 4
    DFN9 5 5
    DFN10 6 6
    DFN11 7 7
    DFN12 8 8
    DFN13 9 9
    * FN5 = data is in EBCDIC , and ignore escape sequences
    C MOVE X'C0' FN5
    * FN6 = EBCDIC data is code page 500
    C MOVE X'01' FN6
    * FN7 = "smallest symbol"
    C MOVE X'00' FN7
    * FN8 = level L - 7% recovery - x'00'
    * level M - 15% recovery - x'01'
    * level Q - 25% recovery - x'02'
    * level H - 30% recovery - x'03'
    C MOVE X'02' FN8
    * FN9 = structured append sequence indicator
    C MOVE X'00' FN9
    * FN10 = total number structured append sequences
    C MOVE X'00' FN10
    * FN11 = structured append parity data
    C MOVE X'00' FN11
    * FN12 = UCC/EAN FNC1 and Industry FNC1 flags
    C MOVE X'00' FN12
    * FN13 = Application Identifier (AI) for Industry FNC1
    C MOVE X'00' FN13
    * Append the data to be barcoded to the special QR code bytes and write it out.
    C EVAL FIELD1 = FN+'My data'
    C EVAL *INLR = *ON
    Attached Files
    Last edited by A.Grubb; 03-04-2019, 04:30 PM.