Question

Barcoding Code in RPG400

Asked by: Praveen_WS

Hi,

I want a program in RPG/400 for Barcoding.  Please I need sample code for both read & write

Barcode.  Yes, separate Read barcode RPG & Write barcode programs is required.

I will give you the printer specification. I have two printers: One is Wipro 1050 printer

and the other one is SATO CT400 printer.

We normally use the Wipro Printer for our AS/400, the device named for this printer is

'purprn'.  The SATO printer is purchased for barcode printing from other applications and

not AS400.

Plz, I need programming code for both printers.

Regards,
Praveen.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Barcodes
    Hello Friend Actually i want to do it programmatiaclly and wnat know how control the deviec and how to take the result from device after reading it and i wnat to store that result in database which is communicating with the VB co...
  2. barcode
    How can I use barcode (for scanning the codes) into my application
  3. AS400 Barcode RPG program
    Hi Pls help for sample code to read & write Barcode using RPG400 or ILE400. Pls separate the Read barcode RPG & Write barcode programs. Thanks & Rgds Heng03
  4. Barcode printing
    Hi Experts, I have a printerfile where a barcode is specified like : A BAR1 6 BARCODE(CODE3OF9 *NOHRI + A (*WIDTH 0.010) (*RATIO 2)) A POSITION(0.200 0.100) The resul...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: murphey2Posted on 2008-07-18 at 07:01:06ID: 22035852

Hi Praveen,

For the reading, you need a bascode reader (mostly attached to USB).
this will fill the field where the cursor is with the barcode information.
doesn't matter if this is Notepad, dos-prompt or a AS/400 terminal emulation.

Writing barcodes is done via a barcode field in a printer file ( see snippet)
The example prints a 6 position picknumber in barcode for the warehouse.

Good luck,
Murph

A          R BAR01                                                  
A            BAR1           6          BARCODE(CODE3OF9 *NOHRI  +   
A                                      (*WIDTH 0.015) (*RATIO 2))   
A                                      POSITION(0.200 0.100)        

                                              
1:
2:
3:
4:

Select allOpen in new window

 

by: murphey2Posted on 2008-07-18 at 07:50:18ID: 22036381

BTW This is what the manual tells:

5.6 BARCODE (Bar Code) Keyword
 
Use this field-level keyword to print a field as a user-specified bar code.  BARCODE is valid only for Intelligent Printer Data Stream* (IPDS*) printers and only for printer
files with device type *IPDS or *AFPDS specified.
 
The format of the keyword is:
 
  BARCODE(bar-code-ID [height] [[*HRZ | *VRT]
  [*HRI | *HRITOP | *NOHRI] [*AST | *NOAST]
  [check-digit] [unit-width]
  [wide/narrow-ratio]])
 
The bar-code-ID parameter is required. Valid values for the bar code ID are listed in Figure 5-6.
 
The height parameter is optional, but if it is specified, it must be the second parameter following the keyword. Valid values for the bar code height are 1 through 9 lines. The
value you specify for the bar code height does not include the human readable interpretation below the bar code. If you do not specify the height parameter, the printer uses a
default height.
 
You can specify the last 6 parameters (all optional) in any order. Using these parameters, you can specify that BARCODE:
 
   Print the bar code horizontally or vertically. The default is horizontal printing (*HRZ).
 
   Include or exclude the human readable interpretation of the bar code. The default is to include the human readable interpretation printed at the bottom of the bar code
    (*HRI).
 
   Indicate that the human readable interpretation should be printed at the top (*HRITOP) of the bar code. (Check individual printer manuals for different bar code support of
    *HRITOP.)
 
   Include or exclude asterisks around the human readable interpretation for CODE3OF9 barcodes. The default is to exclude the asterisks (*NOAST).
 
   Select the check digit type. This is a 1-character hex value that cannot be hex FF.
 
   Specify the width (in inches) of the narrow bar/space. It is specified as an expression of the form (*WIDTH value). For more information on how to specify expressions,
    see "Syntax Rules" in topic 2.2. The valid values for the parameter are 0.007 through 0.208.
 
   Specify the ratio of the wide bar/space to the narrow bar/space. It is specified as an expression of the form: (*RATIO value). The valid values for the parameter are 2.00
    through 3.00.
 
 
Note:  The overall barcode width is dependent on:
 
          Ratio or width parameter in user DDS.
 
          Actual customer data in the barcode.
 
          Limitations of printer hardware, such as PEL density, pins and so on.
 
 
 
The width and ratio parameters are ignored for the 4234 and 4224.
 
For more information about the 4224 printer models, see the 4224 Printer Models 1xx and 2xx Product and Programming Descriptions, GC31-2551.
 
If you specify an optional parameter that does not apply to the bar code ID you have specified, the printer ignores the optional parameter.
 
If you attempt to print a bar code on a printer that does not support bar codes, the digits in the code are treated as text, and a diagnostic message results stating that the bar
code could not print.
 
The line and position you specify for the field is used as the upper left corner of the bar code. Because the line specified in the DDS is the base line (the imaginary line on
which characters are printed) and this is used as the upper edge of the bar code, the bar code appears to extend down from the bottom of the line you specify.
 
Figure 5-6 describes valid data types and field lengths for the BARCODE field.
 

 Figure  5-6. Valid Bar Code Definitions                                
,,$
 Bar Code ID            Data Type               Field Length          
<<$
 MSI                    S                       1 through 31(1)       
<<$
 UPCA                   S                       11                    
<<$
 UPCE                   S                       10                    
<<$
 UPC2                   S                       2                     
<<$
 UPC5                   S                       5                     
<<$
 EAN8                   S                       7                     
<<$
 EAN13                  S                       12                    
<<$
 EAN2                   S                       2                     
<<$
 EAN5                   S                       5                     
<<$
 CODEABAR               A                       1 through 50          
<<$
 CODE128                A                       1 through 50          
<<$
 CODE3OF9               A                       1 through 50          
<<$
 INTERL2OF5             S                       1 through 31          
<<$
 INDUST2OF5             S                       1 through 31          
<<$
 MATRIX2OF5             S                       1 through 31          
<<$
 POSTNET                S                       1 through 31          
<<$
 RM4SCC                 A                       1 through 31          
<<$
 JPBC                   A                       7 through 50          
44$
 Note:  (1) The 4234 Printer only supports 14 digits.                   

 
Figure 5-7 describes the supported bar codes.
 

 Figure  5-7. Bar Codes Supported by DDS                                                                    
,,,,,$
                                                          Default Check                                
                      Digits per     Range of Characters  Digits          Default Check   Valid Check  
 BARCODE              Code           Allowed              Generated       Digits Printed  Digits       
<<<<<$
 MSI (changed         31(1)          0 through 9          2 Modulus 10    No              01 through   
 Plessey)                                                                                 09           
<<<<<$
 UPC-A                11             0 through 9          1               No              00           
<<<<<$
 UPC-E                10             0 through 9          1               No              00           
<<<<<$
 UPC-2 digit add on   2              0 through 9          No              No              00           
 (must follow a UPC                                                                                    
 A or E bar code)                                                                                      
<<<<<$
 UPC-5 digit add on   5              0 through 9          No              No              00           
 (must follow a UPC                                                                                    
 A or E bar code)                                                                                      
<<<<<$
 EAN-8                7              0 through 9          1               Yes             00           
<<<<<$
 EAN-13               12             0 through 9          1               Yes             00           
<<<<<$
 EAN-2 digit add on   2              0 through 9          No              No              00           
 (must follow an EAN                                                                                   
 8 or 13 bar code)                                                                                     
<<<<<$
 EAN-5 digit add on   5              0 through 9          No              No              00           
 (must follow an EAN                                                                                   
 8 or 13 bar code)                                                                                     
<<<<<$
 INDUST2OF5 or        31             0 through 9          1               Yes             01 02        
 industrial 2 of 5                                                                                     
<<<<<$
 MATRIX2OF5 or        31             0 through 9          1               Yes             01 02        
 matrix 2 of 5                                                                                         
<<<<<$
 INTERL2OF5 or        31             0 through 9          1               Yes             01 02        
 interleaved 2 of 5                                                                                    
<<<<<$
 CODEABAR             Up to 50       0 through 9,         1               Yes             01 02        
                      characters     A through D                                                       
                                     (begin/end only),                                                 
                                     -, ., $, /, +, and :                                              
<<<<<$
 CODE128              Up to 50       Refer to             1               No              01(2) 02     
                      characters     Appendix G, CODE128                                               
                                     Character Set                                                     
<<<<<$
 CODE3OF9 or code 3   Up to 50       0 through 9,         No              No              01 02        
 of 9                 characters     A through Z                                                       
                                     (upper case only),                                                
                                     -, ., $, /, +, %,                                                 
                                     and a blank                                                       
<<<<<$
 POSTNET              Up to 31       0 through 9          1               Yes             Ignored      
                      characters                                                                       
<<<<<$
 RM4SCC               Up to 31       0 through 9          1               Yes             Ignored      
                      characters     A through Z                                                       
<<<<<$
 JPBC                 Up to 50       0 through 9, A       1               Yes             00 01(3)     
                      characters     through Z, and -                                                  
44444$
 Notes:                                                                                                     
                                                                                                            
 1.  The 4234 Printer only supports 14 digits.                                                              
                                                                                                            
 2.  The value 01 for the check digit is not valid for some printers.                                       
                                                                                                            
 3.  The value 01 provides migration support for application programs that use an AFP font to print Japan   
     Postal Bar Codes. Data written into the field must be valid characters in the AFP font. The            
     application program must also write the start, stop, and check digit characters.                       

 
CODEABAR field data must begin with an A, B, C, or D and must end with an A, B, C, or D. For example, A11224455C or D33447799D.
 
Do not specify BARCODE in the same field with the CHRSIZ, CHRID, CVTDTA, DATE, EDTCDE, EDTWRD, FONT, HIGHLIGHT, PAGNBR, TIME, or UNDERLINE keywords.
 
See the CVTDTA keyword for information on coding IPDS bar code commands yourself.
 
If you specify CHRSIZ at the record level, it applies to all fields in that record. If you specify BARCODE in one of those fields, the BARCODE keyword is not allowed.
 
You cannot specify BARCODE on the same record format with BLKFOLD, CPI, or DFNCHR.
 
When you specify BARCODE on a numeric field, the number of decimal positions must be zero.
 
When you specify BARCODE on a constant field, the only valid bar code IDs are CODEABAR, CODE128, and CODE3OF9, and you must also specify the DFT keyword either
implicitly or explicitly.
 
You should specify DEVTYPE (*IPDS) or DEVTYPE(*AFPDS) on the CRTPRTF command when BARCODE is specified in the file.
 
BARCODE is allowed only on data types S and A (see Figure 5-7 for restrictions).
 
Option indicators are not valid for this keyword.
 
Japan Postal Bar Codes (bar-code-ID = JPBC) uses only the bar-code-ID parameter, the bar code print orientation parameter (^*HRZ | *VRT‘), and the check digit parameter.
All other parameters have predetermined values so any input for them is ignored.
 
User specified check digits are not validity checked and could cause bar code errors if they are not valid. The Intelligent Printer Data Stream Reference manual contains
more information on bar codes and valid check digits.
 

 

by: Praveen_WSPosted on 2008-07-18 at 22:24:25ID: 22041435

Hi Murph
Thank you for what ever you have sent.  I already have this with me, downloaded from Ibm site.

As I said I am using Sato CX Series Printer for Barcode.  So, I need a sample code for reading and also writting.  I have attached a label which I want to print using AS400, written in RPG400.

I also have the Barcode Scanner(Manufacturer: Symbol).  These hardwares are not used through AS400.  But I want to use it by writting code in RPG.  I need your help, plz provide me some sample codes.

Regards,
Praveen.

 

by: Praveen_WSPosted on 2008-07-18 at 22:30:36ID: 22041450

Hi,
I would like to add, apart from RPG Coding if it requires DDS code for creating the Label and also for storing data(PF).

Plz mention the coding for the same.

Thanks and I doubled the points.
Praveen.

 

by: murphey2Posted on 2008-07-19 at 14:59:56ID: 22043790

Hi Praveen,

There is no input program required for barcode scanning, the scanner just work likes a keyboardemulation, that's all.
The output to a label or barcode is the same as output to any other printing program, not very special.
Except if the "Sato CX Series Printer for Barcode" is a special printer with his own printer langage, as UBI and Zera printers has teir own UPL and ZPL langage.
Please wait till monday and I will look in the office if i have a Sato CX Series Printer for Barcode manual somewhere.

Regards,
Murph

 

by: Gary_The_IT_ProPosted on 2008-07-20 at 14:11:06ID: 22046986

As Murph said, there is no special code required to read barcodes from a keyboard-wedge barcode reader.  You just create a standard 5250 application with a display file.  If you are scanning a single field, or if the barcode field is the last value on the screen, it is handy to use the auto-enter keyword CHECK(ER) on the barcode field (assuming you are scanning fixed-length barcodes).  

Refer to the IBM DDS Reference for information on the CHECK(ER) keyword.

What you need to do is to be able to pass specific ASCII control codes to your printer from your RPG program.  Unfortunately, in the bar-code world, each manufacruter often has their own private control codes.  This means that you have to write a different program (or create a database of codes) for each printer.

This IBM-supplied program demonstrates the process for sending raw ASCII to an AS/400 attached printer.  Then, you just need to consult the device programming guide for your Sato CX printer to find the right series of commands to send to generate your label.  You'll need to specify position, font, spacing, etc.  Some printers support the creation of a "form" that they store in memory in the printer that can reduce the size of the data stream that you need to send each time you print the same format label.

IBM ASCII Transparency program:

http://www-912.ibm.com/s_dir/slkbase.NSF/0/3788b4d775308174862565c2007d473e?OpenDocument&ExpandSection=3#_Section3

Sato Programming Manuals:

http://www.satoamerica.com/Operator+and+Technical+Manuals/98

Sato CX 400 Programming manual:

http://www.satoamerica.com/Images/CMSImage_98_49.pdf

Of course, of you have to do a lot of this kind of work, it is a lot easier to just purchase a package like TL Ashford Barcode 400, which already has support for hundreds of different barcode printers built-in.  I've used this as a barcode printing solution in dozens of shops.  They support most popular barcode printers, including a long list of models from Sato.  The CX is new, and is not listed, but you can call TLA to see if it is supported.  You can have labels up and running in a couple of hours, even if you've never used the software before.  You go into the forms designer, create your layout, and then run the form from either a CL command, or by calling a TLA API to process a single label or a batch of labels from information in a file.  Comes with sample programs ready to copy and run.

http://www.tlashford.com/

Hope that helps.

-Gary Patterson

 

by: murphey2Posted on 2008-07-20 at 14:53:47ID: 22047122

Hi Praveen,

CHECK(ER) is only recomended if you don't need no type (or scan) other info in that screen.
I will send you the program sample tomorrow.
(if I can find it :))

Regards,
Murph

 

by: murphey2Posted on 2008-07-21 at 02:35:22ID: 22049018

Hi Praveen,

Sorry, we reprogrammed all labels to zebra ZPL, so no Sato is available anymore, but maybe I can halp you anyway.
The fastest and most reliable way to create a label is not to print it, but send it to the printer with FTP (if possible). In that case, no driver or spoolwriter can add fatal codes to the label.
The first thing you have to do is create a simple test label to be sure how to get something out of the printer.
You can use any language for that (I prefer VB because it's easy to read and change)
attached a tiny example to create a text file that can be send to the printer,
Just try and play a little with the "H200" and "V100" to get an idea how it will work

Because I don't have any PC developent language on this PC, I did it in Excel VBA, so just add the attached snippet to excel, execute and ftp it to your printer.
The attached file is the result of the snippet and can be printed to your printer (you can try).

Programming labels it a lot of trying and shifting text up and down :)


Sub label()
 
Open "c:\label.txt" For Output As #1
 
E$ = Chr$(27)
 
Print #1, E$; "H0200"; E$; "V0100"; E$; "MyLabel";
Print #1, E$; "H0500"; E$; "V0100"; E$; "B103100*Label*"
Print #1, E$; "Q1";
Print #1, E$; "Z";
 
Close
 
 
End Sub

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:

Select allOpen in new window

 

by: Gary_The_IT_ProPosted on 2008-07-21 at 08:15:43ID: 22051281

Praveen,

CHECK(ER) works just fine even if there is other information on the screen that is being entered manually.  You just need to position the barcode field with CHECK(ER) is the last field on the screen (as I stated in my earlier post).

In many barcode applications, the barcode field is the only field on the screen.  this works fine too.

-Gary Patterson

 

by: murphey2Posted on 2008-07-21 at 11:08:09ID: 22052903

Hi Praveen,

If you need to use the barcode to read in an exisint program, and like to have auto enter, you dont need to alter the program, in most of the cases, you be able to add a trailing character in the scanners setup.
(We use the "|" pipe-symbol) in your terminal emulations key-bard mapping, you can replace this character by an enter function, so that the scanner sends a | at the end of every scan, and the as/400 get it as a enter key.

About setup, even there is a control character in most of the barcodes, it will happen now and then that a wrong baarcode is red by the scanner. I advise to use the overscan option (or multiscan) with this option the scanner automatically cans multiple times and take the hit as you set up 2 ot of 3 or 4 out of 5 .
To prevent peaople to scan the barcode twice (double input in the program) you also change a setting in the setup, that prevent that the same barcode is red twice (without scanning an other code first)
All setup seqences can be found in the scanners manual.

Regards,
Murph

 

by: Praveen_WSPosted on 2008-07-27 at 22:57:58ID: 22100888

Dear Murph,

Thank you for all the good programming suggestions.  I am struggling to create a basic report program in which I have added a barcode field.  Can you help in posting an example code.  Any four fileds including a fileld with barcode.  I want to print a label.  Say three input fields after entering the value, if given print command(using any function key), the label should print with those entered values in three fields along with a barcode.

Thank you Gary for your support.

Regards,
Praveen.

 

by: murphey2Posted on 2008-07-28 at 11:31:09ID: 22105576

Hi Praveen,

I will look in the office tomorrow  for a sample program.

Regards,
Murph

 

by: murphey2Posted on 2008-07-29 at 06:49:08ID: 22111382

As promised, a little program that print 3 text fileds + a barcode

Copy the file BAR001.TXT to an RPGLE-Source
Copy the file BAR001D.TXT to an DDS-Source type DSPF
Copy the file BAR001P.TXT to an DDS-Source type PRTF

Compile BAR001D
Compile BAR001P with compiler option DEVTYPE(*AFPDS)
Compile BAR001

Run by : CALL BAR001

It's just a QAD example but with nothing else then you asked for.

Good luck,
Murph

 

by: Praveen_WSPosted on 2008-07-31 at 02:30:40ID: 22128090

Murph,

Thank you very much, I will try and get back to you.


Regards,
Praveen.

 

by: Praveen_WSPosted on 2008-08-04 at 03:20:11ID: 22151236

Murph,

Ok, I have tried and can get the output, however to get the barcode,
I have added following line to get the barcode output while I print.
c                   eval      bar1='123456'

However, "Bar codes not displayed" error is displayed in the spool file.  And if I assign the Printer, then it goes to HLD status always.

And one more thing I have also changed the Printer Device Type as *AFPDS and Unit of Measurement as *CM.

Please help me in getting the barcode print.

Thanks,
Praveen.

 

by: murphey2Posted on 2008-08-04 at 11:17:37ID: 22154664

Hi Praveen,

The code I send you was compiled without errors and processed with a result containing a barcode.

I will check again tomorrow what the printed barcode contains, but the sample will print
as long as the printerfile is compiled with *AFPDS

Regards

 

by: Praveen_WSPosted on 2008-08-04 at 23:33:01ID: 22158579

Murph,

The code is perfectly working.  But the Barcode print is not coming.  So I added the extra line, which also not giving any barcode print.

I am sending spool file to a WIPROLMP P-500 LINE PRINTER, this is network printer

Murph can I give you 500 points for all the efforts you are taking for me..

Thank you.

 

by: murphey2Posted on 2008-08-05 at 00:14:57ID: 22158748

A line printer?
do you mean a dot-matrix printer? I think you will never get a barcode from such printer.
Unless it's an IPDS printer, in that case recompile your BAR001P printerfile with *IPDS instead of *AFPDS.

Did you test the output on a laser printer?

Regards,
Murph

 

by: Praveen_WSPosted on 2008-08-05 at 04:07:36ID: 22159749

Murph,

I have tried with laser printer, it is HP 2015.. except the barcode rest of the text in the three fields entered is printed.

regards,
Praveen

 

by: Gary_The_IT_ProPosted on 2008-08-05 at 06:08:10ID: 22160483

I thought the task was to print a barcode on the Sato CX?  That takes a whole different approach than to print on an AFP (or AFP via Host Print Transform) printer.

Murph's program, above, generates AFP (Advanced Function Printing) printer language.  You need an AFP printer to print AFP-language spooled files, OR you need to tell the AS/400 operating system to use the Host Print Transform (HPT) function to convert AFP to the printer's native language.

The Sato CX does not "speak" AFP.  It uses a proprietary printer language that is not supported by HPT.  That means that your program has to "speak" the Sato's language directly, and you need to take steps (Ascii Transparency) to make sure that no formatting of the print stream is done by the operating system before sending it to the printer.  You have to look up the commands in the Sato manual, and then create strings in your program containing the various printer commands.  It is a real pain.  See my earlier comments for sample code for this approach.

Most people buy software to do this, like TL Ashford's Barcode/400.  It has all of this support built in for a bunch of proprietary printers.

The HP 2015 is a different animal.  It supports the popular PCL printer language, and Host Print Transform knows how to generate various flavors of PCL from AFP.

Try configuring the HP 2015 with:  TRANFORM(*YES) MFRTYPMDL(*HP5SI).  This tells the AS/400 print subsystem to turn on Host Print Transform, and also which IBM-supplied workstation customization object to use to translate AFP into HP PCL.

Check out this IBM Redbook for more information on configuring Host Print Transform:

http://www.redbooks.ibm.com/redbooks/pdfs/sg242160.pdf

This IBM Support Document provides HPT settings for many ASCII printers:

http://www-912.ibm.com/s_dir/slkbase.NSF/0888cc5d18fceca58625680b005dc690/b44a2cf4ba778d83862568250053649f?OpenDocument

HPT Settings for HP Printers, including the 2000 Series:

http://www-912.ibm.com/s_dir/slkbase.NSF/7c4c0f5a4d52e3c4862569b4005d198a/ba0863cfa6463903862569c10078c903?OpenDocument

All of that said, if at the end you need to print barcodes on the Sato, Host Print Transform won't help - you'll need to use ASCII transparency and figure out the stream of printer commands that you need to send to the printer to format your label.

 

by: murphey2Posted on 2008-08-05 at 09:15:27ID: 22162413

Hi Praveen,

I'm almost sure that the HP 2015 is supporting AFP, check the DEVD of that printer on the AS?400 and try to change it in AFP, to tell the AS/400 that AFP data can be send.

Regards,
Murph

 

by: Gary_The_IT_ProPosted on 2008-08-05 at 09:45:42ID: 22162711

Murph / Praveen,

The HP 2015 isn't an AFP printer.  As far as I know, HP doesn't make any native AFP printers.  It is just a little personal laser that supports PCL5e, PCL6, and HP Postscript L3:  

http://h10010.www1.hp.com/wwpc/us/en/sm/WF06a/18972-18972-3328059-14638-3328066-1845551.html

You CAN, however, use Host Print Transform on the AS/400 to convert from AFP to PCL5e per my instructions above.

HP also offers "The Blue Kit" which can convert some HP printers into AFP/IPDS printers:

http://www.hp.com/sbso/product/printing/laserjetfonts/emulation.html

- Gary Patterson

 

by: Gary_The_IT_ProPosted on 2008-08-05 at 10:07:41ID: 22162910

Praveen,

Setting the HP 2015 outq or device description to DEVTYPE(*AFPDS) or AFP(*YES) isn't enough.  You need to use host print transform and specify the manufacturer type and model as in my earlier comment:

TRANFORM(*YES)
MFRTYPMDL(*HP5SI)

And regardless of how the printer is configured, you won't be able to view the barcode from WRKSPLF - you'll need to actually print it.

Regards,

-Gary

 

by: Praveen_WSPosted on 2008-08-06 at 04:52:35ID: 22169100

Thank you Gary and Murph...

I was thinking it is so simple but it is not.  I will be out of my office, so I will be out of touch with AS400.  I try your suggestions and once I gone through I will get back to you.

Thank you once again.

Have a nice time.
Rgds,
Praveen.

 

by: Gary_The_IT_ProPosted on 2008-08-06 at 08:26:51ID: 22171291

Praveen,

As Murph's examples show, printing barcodes on an AFP printer is pretty easy.  IBM expects you to use an AFP printer for this sort of thing on the iSeries.

If you don't have an AFP printer, a lot of common printers can be used (with some limitations) through Host Print Transform, which converts AFP into the target printer's native language on the fly on the AS/400.  There is an extra step, of course - you have to configure HPT for the target printer on the AS/400 (DEVD or OUTQ).

When you get away from AFP printers (and HPT-supported printers) is when it gets complex - then you have to write programs that output low-level printer language, and that varies from manufacturer to manufacturer and even from model to model.

-Gary

 

by: murphey2Posted on 2008-08-06 at 10:51:14ID: 22172935

Hi Praveen,

If you use barcodes ore then sometimes, and the result must be constant, skip Laserprinters and lineprinters completely.
Try to shop for a Barcode printer Like Zebra, Stripe or UBI
Zebra and Stripe are the most used, but UBI is far more easy to  program without experience.

Regards,
Murph

 

by: Praveen_WSPosted on 2008-08-24 at 02:33:41ID: 22300035

Murph,

I am back to office, I will try and let you know.

Thanks,
Praveen.

 

by: Praveen_WSPosted on 2008-08-28 at 02:02:41ID: 22332714

Hi Murph & Gary,

I was trying a program to send a data stream, I get the output as:  $.  Ú  Ø~ «  
snippet is added below.

However, I am unable to print the barcode, I studied and checked, my pdt file is correct for the printer HP 2015.  What more programming I need to do.

Is that I need to write a printer program - O-Spec.  Is there no easy way out.  
Actually I am not getting enough time to study all the documents you have sent to me.  I m reeeeely soorry..

Do you have any program written for a HP Printer.  The barcode output gets from any HP LASERJET Printer??

Thanks,
Praveen.

    FQSYSPRT O   F      19            PRINTER
    E                    CHR        19  1               DATA STREAM
    C                     BITOF'0123'    CHAR1   1
    C                     MOVE CHAR1     CHR
    C                     BITON'67'      CHR,1
    C                     BITON'37'      CHR,2
    C                     BITON'3467'    CHR,3
    C                     BITON'13467'   CHR,4
    C                     BITON'1467'    CHR,5
    C                     BITON'45'      CHR,6
    C                     BITON'0123456' CHR,8
    C                     BITON'237'     CHR,9
    C                     BITON'7'       CHR,10
    C                     BITON'0'       CHR,11
    C                     BITON'027'     CHR,12
    C                     BITON'7'       CHR,13
    C                     BITON'046'     CHR,14
    C                     BITON'5'       CHR,15
    C                     BITON'5'       CHR,16
    C                     BITON'5'       CHR,17
    C                     BITON'5'       CHR,18
    C                     BITON'5'       CHR,19
    C                     EXCPTCONDIT
    C                     SETON                    LR
    C            EOJ      TAG                            +++ EOJ
    OQSYSPRT E                CONDIT
    O                         CHR
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:

Select allOpen in new window

 

by: murphey2Posted on 2008-08-28 at 07:38:57ID: 22335385

Hi Praveen,

The example I posted here was a working example on a Lexmark printer, that runs also PCL like HP, so that is no problem.

The C lines above can be replaced by Dspecs like :
And use the DS name :)

DCHAR             DS            19              
DC01                             1    Inz(X'03')
DC02                             1    Inz(X'11')
DC03                             1    Inz(X'1B')
DC04                             1    Inz(X'5B')
DC05                             1    Inz(X'4B')
DC06                             1    Inz(X'0C')
DC07                             1    Inz(X'00')
DC08                             1    Inz(X'FE')
DC09                             1    Inz(X'31')
DC00                             1    Inz(X'01')
DC11                             1    Inz(X'80')
DC12                             1    Inz(X'A1')
DC13                             1    Inz(X'01')
DC14                             1    Inz(X'8A')
DC15                             1    Inz(X'04')
DC16                             1    Inz(X'04')
DC17                             1    Inz(X'04')
DC18                             1    Inz(X'04')
DC19                             1    Inz(X'04')

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:

Select allOpen in new window

 

by: murphey2Posted on 2008-08-28 at 07:41:45ID: 22335425

BTW i inserted line C07 my self I assumed it should be x00 becuse it was missing in your source

DC07                             1    Inz(X'00')

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...