15
Tue, Oct
6 New Articles

Creating Custom Printer Function Tables

Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

The PFTSETUP program is intended for use by programmers, technicians, or printer function experts.”

This ominous statement in an IBM technical manual made me curious. What was the PFTSETUP program, where could I find it, and why wasn’t I supposed to use it? What exactly is a “printer function expert,” anyway? To find the answer to these questions, we first have to look at Client Access/400 and how it handles workstation function (WSF) printer sessions.

We know that all printers provide basically the same functions. They can all print bold characters, underlined words, and upper- and lower-case letters. A personal computer controls these functions by sending the printer a series of control characters. A control character is a hexadecimal value that instructs the printer to turn a particular function on or off. If you wanted to print a word in bold, for instance, the computer would first send a hexadecimal value which would tell the printer to turn bold printing on. After sending the word to be printed, the computer would then send another hexadecimal value to tell the printer to turn bold off. The problem is that not all printers speak the same language. The value that instructs an IBM printer to start bold printing, for example, might be different than the value used to start bold printing on an Okidata printer. Client Access/400 overcomes this problem through the use of a predefined printer function table (PFT).

A PFT is a table, exclusive to a particular make and model of printer, that contains all the control codes needed to control that printer. More than sixty predefined PFTs are provided with Client Access/400, including tables for many popular makes and models of printers. What if you have a printer that isn’t among those 60-plus printers? That’s where the mysterious PFTSETUP program comes in. PFTSETUP is a program that allows you to create a new PFT or modify an existing PFT to handle your printer.


 

Running PFTSETUP

 

The PFTSETUP program is located in the MRI2924 subdirectory of your Client Access/400 program directory. The program is run from the DOS prompt and requires 330KB of free memory. The printer you are defining should be connected to your PC and powered on. If your printer is a serial printer, you must first redirect the printer output to the serial port with the DOS MODE command. The following is an example of this command, although your printer documentation may provide you with a different baud rate or other parameters.

MODE COM1:1200,n,8,1,p
MODE LPT1:=COM1

The first MODE command sets the communication parameters for the serial port. The second MODE command redirects printer output to the serial port. To start the PFTSETUP program, change your current directory to the MRI2924 subdirectory and type PFTSETUP. You will be presented with an introductory screen with the IBM logo. Press Enter to continue. The program will then ask if you want to create a new PFT or edit one of the existing PFTs. (For a complete listing of PFTs supplied with Client Access/400, see Appendix A.1.1 of the Client Access/400 for DOS and OS/2 Technical Reference.) If you are modifying an existing PFT, it is always a good idea to make a backup copy of the original before you begin.

Whether you choose to create or modify a PFT, you will be shown a screen that briefly describes the program and provides a disclaimer that not all functions may work on your printer. It also explains that you must contact your printer manufacturer to receive the correct control codes for your printer. Many printer manufacturers supply the control codes in the documentation that comes with the printer. If you did not receive the control codes with your printer, you may have to call or write the manufacturer, or try accessing their Web site on the Internet to obtain the proper codes. The program then informs you that not all of your printer functions are supported by WSF. Although most major functions are supported by WSF, the following functions are not: multiple copies, slot selection definition, control sequence file name, continuous feed select, ignore/enable paper end sensor, collate, set left margin, and user-defined controls, except number 984-
999. (We will discuss user-defined controls a little later.) You will be prompted to enter the name of the new or existing PFT and also the LPT port of the printer and whether it is continuous or cut-sheet feed. (This information is used for testing purposes.)

Next, you will be presented with the menu pictured in Figure 1, from which you can make selections and enter the corresponding control codes for your printer. If your printer documentation indicates that a particular function calls for control code Esc E, for instance, you would enter 1B 45 in the space provided (1B is the ASCII hexadecimal value for Esc and 45 is the ASCII hex value for E). Note that pairs of hexadecimal characters are separated by a space and can be entered in upper- or lower-case letters.

Menu selection number 6 is for user-defined controls. Although we will not cover these controls in detail, WSF supports the following user-defined controls:

• 984-985—used to specify envelope size
• 986-987—used to specify page size
• 988—used to define printer data stream used in the PFT
• 989-991—used with HP LaserJet IID printers to define simplex and duplex printing

• 992—used to move the output tray for easier paper separation
• 993-996—used to define portrait and landscape page rotation
• 997-999—used to control computer output reduction if output will not fit on one page in portrait mode


 

Testing Your Work

 

Before testing your work, it is best to save your PTF first by pressing Esc and selecting the Save and Continue option. Begin the printer tests by selecting option 7 on the menu. You will be shown the Function Selection Tests menu as shown in Figure 2. You may select to run the tests individually or select option 1 to run all of the printer tests. (You do not need to run option 8, Cursor Draw (Box) Characters, as this function is not supported by WSF.)

The test will print a series of samples and ask you which sample is correct. If none of the samples prints correctly, you can return to the Create/Edit Printer Function Table menu to redefine the control character sequence for that function. Continue to run the tests and make corrections until the test samples print correctly. Remember to save your corrected PFT before exiting the program.

To use your newly created printer function table, you need to create or modify a WSF printer session, specifying the new PFT. (For detailed instructions on creating a WSF printer session, see the Client Access/400 Setup Guide for the type of Client Access you are using.)

 

Where to Go From Here

 

If you are interested in learning more about Printer Function Tables, refer to Appendix A of the Client Access/400 for DOS and OS/2 Technical Reference Guide. If you made it this far, you are well on your way to becoming a “printer function expert,” fully qualified to use the PFTSETUP program to customize your own PFTs.

Figure 1: The Create Printer Function Table Menu


 

Creating_Custom_Printer_Function_Tables03-00.jpg 250x197

 

 

Creating_Custom_Printer_Function_Tables04-00.jpg 450x225

 

Figure 2: The Function Selection Tests Menu


BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: