Brief: You don't need the expense of an IPDS printer to create barcodes on your AS/400. You can use less-expensive, PCL5-capable laser printers like Hewlett- Packard LaserJets and IBM Lexmark LaserPrinters. With the PCL5 printer control language (innate in many PC laser printers) and, in some cases, custom font cartridges, you can create barcodes for less than you might expect.
I had the opportunity to develop a barcode labeling system that included labels for the manufacturing and shipping industry (e.g., raw material, work-in- progress and shipping labels). Prior to the new system, my shop used a third- party, PC-based labeling software package and PC-compatible printers. This package worked with data downloaded to the PC from the AS/400. The PC manipulated it, formatted the label layout and produced the number of labels requested. While it was a workable solution, certain limitations became apparent as the company's labeling requirements changed.
Interpretation of special characters was the main limitation. With the prospect of adding more special characters to the labels, things didn't look very promising. The speed of this application also raised some concerns; it took quite some time for the dedicated PC to generate the labels.
With a good feel for the company's labeling requirements and the limitations of the present system in mind, I started analyzing the options.
The Options
I identified four options for the new labeling system:
1. Use IPDS printers and the DDS BARCODE keyword. 2. Use IPDS printers and Advanced Function Printing Utilities/400. 3. Buy another third-party labeling software package. 4. Develop my own labeling system.
The main requirements for the new system were low cost, quick generation of labels and easy maintenance. The only advantage of the existing third-party labeling software was its use of PC-compatible printers, which are quite inexpensive when compared to IPDS printers. A recent IBM catalog listed an IBM 4039-10R PC printer with PCL5 at $1,599. An IPDS Advanced Function Printing version, IBM 3916-AS1, costs $5,895.
Options one and two were just too expensive for our company. In addition, my previous experience with Advanced Function Printing Utilities/400 was not favorable. When I used Advanced Function Printing Utilities/400 to format material safety data sheets, it added a considerable amount of time to the overall process.
My company operates several plants and warehouses, and every one of them must have a dedicated PC for the label application using the third-party software. Implementation of a new labeling requirement entails installing the new copy of the label layout at every site. Talk about a logistics nightmare-the company's sites span several states. This eliminated option 3.
That left me with the option to develop my own labeling system. Other programmers in my department had already developed some custom forms, using a PC printer control language called PCL5. Most of their experience with PCL5 had been fruitful, and the language appeared to contain all of the features I required. I borrowed a PCL5 Printer Language Technical Reference Manual (Hewlett-Packard part number 5961-0509) and started on my quest. (The technical reference manual for IBM Lexmark LaserPrinters also contains a small section concerning PCL5 emulation.)
My investigations revealed that the only features not built into PCL5 were the actual barcodes or special fonts that I might need. Most laser printers come with several bitmapped and scalable fonts already loaded for easy access. If you need barcodes or special fonts, you can purchase them in the form of cards that slide into the printer. Company logos, signatures and even macros for special forms can be placed on these cards.
My initial application was developed using a Hewlett-Packard LaserJet III with the HP LaserJet Bar Codes & More font cartridge (part number C2053a #C06), available through Hewlett-Packard or an authorized dealer.
Eventually, I decided to use the IBM Lexmark LaserPrinter because of its ability to handle heavy stock. The printer had a PCL5 emulation card installed for labels. No off-the-shelf font cartridge for the Lexmark supported the barcodes and special characters I would need, so I approached a company that could customize a card to meet my requirements. Architext, Inc. developed a cartridge for me that contained a Code 3-of-9 barcode, a trademark symbol, a registered symbol and a Childress 50-point font.
The Software
They say it's best to tackle the worst first. The project which promised to be most challenging was the automotive industry standard level (AIAG) label, which contained several boxes with barcodes inside them. (See 1.) To construct the label, I used PCL5, an RPG program and a printer file created with DDS. To compose the AIAG label in 1, I needed to print more than just the barcode. I printed the following items in the sequence shown:
They say it's best to tackle the worst first. The project which promised to be most challenging was the automotive industry standard level (AIAG) label, which contained several boxes with barcodes inside them. (See Figure 1.) To construct the label, I used PCL5, an RPG program and a printer file created with DDS. To compose the AIAG label in Figure 1, I needed to print more than just the barcode. I printed the following items in the sequence shown:
o The boxes. o The part number. o The part number barcode. o The lot number. o The background shading for the lot sequence.
The RPG shown in 2 is a fragment of the program I used to create the label-it only creates the part number barcode. It is meant to give you an idea of what using PCL5 is like. This is a very simple program created just for this article and does not demonstrate the full potential of PCL5. All the variables in this particular label are alphanumeric, but they can be numeric variables with edit codes.
The RPG shown in Figure 2 is a fragment of the program I used to create the label-it only creates the part number barcode. It is meant to give you an idea of what using PCL5 is like. This is a very simple program created just for this article and does not demonstrate the full potential of PCL5. All the variables in this particular label are alphanumeric, but they can be numeric variables with edit codes.
The barcode formatting consists of an asterisk (*) at the beginning, followed by the variable and another asterisk at the end. See the highlighted section in 2.
The barcode formatting consists of an asterisk (*) at the beginning, followed by the variable and another asterisk at the end. See the highlighted section in Figure 2.
The AIAG DDS specs in 3 have several of the basic PCL5 command groups hard-coded as literals. They are all preceded by a logical not symbol (), used to represent an ASCII escape character. In my configuration, this is accomplished by using a printer function table in a PC Support printer session. (I will cover this in more detail later, along with possible hardware configurations.) Instead of hard-coding the PCL5 commands in the DDS, all of the PCL5 commands could have been formatted in the RPG program in a variable field and passed to the printer file.
The AIAG DDS specs in Figure 3 have several of the basic PCL5 command groups hard-coded as literals. They are all preceded by a logical not symbol (), used to represent an ASCII escape character. In my configuration, this is accomplished by using a printer function table in a PC Support printer session. (I will cover this in more detail later, along with possible hardware configurations.) Instead of hard-coding the PCL5 commands in the DDS, all of the PCL5 commands could have been formatted in the RPG program in a variable field and passed to the printer file.
The following are explanations of some of the important PCL5 commands which I have embedded into the external printer file shown in 3.
The following are explanations of some of the important PCL5 commands which I have embedded into the external printer file shown in Figure 3.
1. Job Control: This is seen in the Reset statement (label A) and is used to reset the printer and prepare it for further instructions. Other examples: Number of copies, Output bin selection.
2. Page Control: The Paper size (label B) and Landscape printing (label C) statements are examples of this command group. Other example: Paper source selection.
3. Barcode and Font Selection: The Select font statement (label D) falls within this command group. The fonts that are available, whether they are resident or on a font card, pretty much determine your choices.
When creating the printer file, you should be aware that the values you submit with the LPI (lines per inch) and OVRFLW (overflow line) keywords may need adjustment, depending on how complicated your form or label is. 4 contains the actual output sent to the printer for the AIAG label.
When creating the printer file, you should be aware that the values you submit with the LPI (lines per inch) and OVRFLW (overflow line) keywords may need adjustment, depending on how complicated your form or label is. Figure 4 contains the actual output sent to the printer for the AIAG label.
If the line spacing [SPACEA(xxx)] is not set properly, the DDS is almost impossible to debug because of overwriting. The trick is to display the spool file, see if there is any overwriting and correct the line spacing.
The Hardware and PC Support
All of the printers I used (Hewlett-Packard and IBM) are attached to a personal computer on a token-ring network using PC Support for the AS/400 printer emulation. You must change the EBCDIC-to-ASCII table for your PC Support printer session to convert the logical not () into the ASCII escape character of hex(1B). You can convert other characters, such as trademark symbols, in the same manner. (See the PC Support/400 Installation and Administration Guide for DOS or OS/2 for information on changing printer-session options.)
PCL5 printers can also be connected to some twinax workstations with ASCII printer ports and through some emulation boards. But, as with PC Support printer sessions, the EBCDIC-to-ASCII translation tables used by the workstation or emulation board must be modified. For twinax workstations, refer to Appendix B of IBM's AS/400 Workstation Customization Function Programmer's Guide. It provides more information on hooking up an ASCII printer to a twinax display. For emulation boards, refer to the emulation board manufacturer's manual.
Depending upon the printer, you may find that the cards which support extra fonts or special characters are available off-the-shelf. Otherwise, a firm such as Architext, Inc. can develop the card for you. The trick to developing a custom card is to incorporate all of the necessary fonts and special characters in one card and then have it duplicated. It is considerably less expensive to copy the original than to keep creating new cards.
Although I have not run across this problem so far, you should be aware that the printer may not have enough internal memory to process all of the commands. However, most PCL5-compatible printers can receive memory upgrades.
Enhancements
One enhancement I made to this labeling project deserves mention. My company needs an offline manual system for finished goods labels, for times when the AS/400 is incapacitated. At night, we run an AS/400 program to create one finished-goods label for every open shop order, but we omit the escape character () in all commands. This data is then downloaded to a PC and converted into a format that FoxPro can use.
A FoxPro program prints the label lines and inserts the ASCII escape character, CHR(27), before each command. If the AS/400 becomes unavailable, the FoxPro program can produce a label that looks as if it were generated by the AS/400.
The Bottom Line
Last but not least is the financial aspect of this approach to barcoding. The cost to create the first custom card for the IBM Lexmark printers-with the trademark symbol, the registered symbol, the Code 3-of-9 barcode and the special font-was $350. Copies of this card cost me $125 each. I needed one original and eight copies, for a total of $1,350.
My old printers were targeted for replacement because of rising maintenance costs, and the ASCII printers are much less expensive than IPDS printers. The fact that I did not need third-party labeling software or IBM's Advanced Function Printing Utilities/400 also helped to keep costs down.
Programming changes for five different types of labels took about three to four weeks to complete.
If you own a PCL5-capable printer (e.g., HP LaserJet or IBM Lexmark), the technology for barcodes, special characters and even certain graphic elements such as boxes and shading is already available. All you have to do is use it. Richard Romanek is a senior programmer/analyst and has been actively involved in the midrange computer industry since 1988.
REFERENCES
AS/400 Workstation Customization Function Programmer's Guide (SC41-0056, CD-ROM QBKA3A01). PC Support/400: DOS Installation and Administration Guide (SC41-0006, CD-ROM QBKA6302). PC Support/400: OS/2 Installation and Administration Guide (SC41-0007, CD-ROM QBKA6802).
VENDOR SOURCE Architext, Inc., 121 Interpark Blvd., Suite 208, San Antonio, TX 78216-1808. Voice: 210-490-2240; fax: 210-490-2242.
Creating Barcodes on a Budget
Figure 1 AIAG Label Created on a PCL5 Printer
UNABLE TO REPRODUCE GRAPHIC
Creating Barcodes on a Budget
Figure 2 LABAIAG RPG Program
... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 H************************* H* AIAG LABEL USING PCL5 * H************************* FLABAIAGOO E PRINTER C* ENTRY PARAMETERS C *ENTRY PLIST C PARM PART# 15 PART NO. C* PART NO. C MOVELPART# PARTN1 C* PART NO. - BARCODE FORMAT C MOVE *BLANK WRK17A 17 C MOVEL'*' WRK17A C CAT PARTN1:0 WRK17A C CAT '*':0 WRK17A C MOVELWRK17A PART1A C* PRINT LABEL C WRITELABELA1 C* C MOVE '1' *INLR ... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
Creating Barcodes on a Budget
Figure 3 LABAIAGO DDS Specifications
... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 A******************** A* LABEL LAYOUT * A******************** A R LABELA1 A SKIPB(001) A* RESET A 1'E' A SPACEA(001) A* SIZE A 1'&l2A' A* LANDSCAPE A +1'&l1O' A SPACEA(001) A******************* A* PART NUMBER * A******************* A* SELECT FONT A 1'(8U(s1p12.00v0s0b4101T' A* POSITION CURSOR A +1'*p350x250Y' A* A +1'PART NO.:' A* POSITION CURSOR A +1'*p350x290Y' A* A +1'(P)' A SPACEA(001) A* SELECT FONT A 1'(8U(s1p24.00v0s3b4148T' A* POSITION CURSOR A +1'*p600x310Y' A* PART NUMBER A PARTN1 15A +1 A SPACEA(001) A******************** A* BAR CODES * A******************** A* SELECT BAR CODE A 1'(0Y(s0p4.69h12.0v0s0b0T' A SPACEA(001) A************************** A* PART NO BAR CODES * A************************** A* POSITION CURSOR A 1'*p400x400Y' A* PART NO. BAR CODE 1 A PART1A 17A +0 A SPACEA(001) ... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
Creating Barcodes on a Budget
Figure 4 LABAIAG Output
E &l2A &l1O (8U(s1p12.00v0s0b4101T *p350x250Y PART NO.: *p350x290Y (P) (8U(s1p24.00v0s3b4148T *p600x310Y 103478 (0Y(s0p4.69h12.0v0s0b0T *p400x400Y*103478*
LATEST COMMENTS
MC Press Online