Instructions on how to print from a PC via a GPIB card to an IEEE-488 HP PaintJet printer. (from Eric Martz, emartz@microbio.umass.edu, 8/94) PAINTJET vs. FILE TRANSFER MODE NOT COMPATIBLE I have not succeeded in being able to retain the HP computer <-> PC file transfer function while simultaneously printing PC->Paintjet. Therefore, you will need two PC boot configurations (to load different versions of the GPIB driver, GPIB.COM, in CONFIG.SYS). You will also need to disconnect the HP computer from the IEEE-488 cable connecting the PC to the PaintJet if the HP is on. This is because the PC must be the GPIB "system controller" in order to print to the Paintjet, and this conflicts with the HP computer, which must be the "system controller" when it is running. UPDATE YOUR DRIVER National Instruments (who manufactured our GPIB card) has excellent technical support. It is available from gpib_support@natinst.com or 800-IEE-E488. I also urge you to obtain by anonymous ftp from ftp.natinst.com the current version of GPIB.COM and IBCONF.EXE suitable for your card. Tell tech support what card model you have, and they will tell you where to find the appropriate driver update on their ftp server. Getting a new driver solved serious problems we were having which at one point (with the original 1987 driver) erased our C: drive! DISABLE YOUR PARALLEL LPT1 I/O DEVICE IF ANY The solution below involves redirecting DOS output to LPT1 to the GPIB card. Therefore you need to disable any hardware LPT1 parallel I/O port present in your computer. This can usually be done by setting a jumper following the instructions which came with your I/O card. Alternatively, you could try redirecting LPT2, but I haven't tried this. If you have a parallel printer on the same computer, probably better to put it on LPT2 and leave LPT1 for the GPIB. This depends on what you want to print on each printer. SET YOUR SOFTWARE TO USE THE DOS DEVICE DRIVER, NOT DIRECT PORT I/O Some software (e.g. Wordperfect) defaults to sending printer output "directly to the I/O port address" which is supposed to be faster. This however bypasses the DOS driver and fails to print. Therefore, in MFI, I had to add a special option NOT to print directly to the port. Similarly, in Windows, it is crucial to turn off "fast printing to port" in the printer setup for the Paintjet. A peculiarity with both Windows and MFI is that when you quit back to DOS, the printer is dead. This is cured by a reboot. I suspect the programs are "closing" the stream to the driver on exit. REMOVE MODE LPT REDIRECTION FROM YOUR AUTOEXEC.BAT If you have any "mode" commands in your autoexec.bat which refer to lpt1, such as "mode lpt1=com1", be sure to disable them! PAINTJET ADDRESSING Our IEEE-488 Paintjet has dip switches near the connector at the right rear corner. The ones labeled A1, A2, A3 are bits for a GPIB address byte. As shipped (and as used for printing on device #6: with our HP computer), A1 is on and A2-3 are off, meaning address 1. The 'normal vs. scs' switch should be set to normal. The 'rom# vs. pc8' switch is optional for the default font, I think; either works. N.B. these switch settings take effect only during power-on. Changes while the power remains on have no effect until the next power off/on cycle. GPIB CONFIGURATION The following instructions are for a National Instruments GPIB-PC2 card, loading GPIB.COM as a driver in CONFIG.SYS, and using IBCONF.EXE to configure the GPIB.COM driver file. If this is not what you have, you're on your own. If you want to retain HP<->PC file transfer capability, you should copy your GPIB.COM to GPIB-HP.COM while that mode works. Then, after using IBCONF to change GPIB.COM to Paintjet mode, copy it to GPIB-PJ.COM. You can then make batch files to copy the correct one to GPIB.COM, boot, and you'll be in the corresponding mode. Note that GPIB.COM is loaded at boot time and so you must reboot when it is changed. The first screen seen with IBCONF has GPIB0 at the top, connected to DEV1 thru DEV16. These DEV#'s correspond to the GPIB addresses of devices on the bus. Use the rename function to rename DEV1 to LPT1 (no colon), assuming you leave your Paintjet at address 1. The IBCONF edit function accesses one set of options if the cursor is on GPIB0 when it is pressed, and a different set if the cursor is on LPT1 when it is pressed. Here are the settings which work: ----------------------------------- GPIB0 ----------------------------------- Primary GPIB Address 24 (note 1) Secondary GPIB Address ........ NONE Timeout setting ............... T10s EOS byte ...................... 00H Terminate Read on EOS ......... no Set EOI with EOS on Write ..... no Type of compare on EOS ........ 7-bit Set EOI w/last byte of Write .. yes System Controller ............. yes (note 2) Assert REN when SC............. no Enable Auto Serial Polling .... no Timing ........................ 500nsec CIC Protocol no Handler type................... pc2 Interrupt setting ............. NONE (note 3) Base I/O Address .............. 02B8H DMA channel (Arbitration) ..... NONE ----------------------------------- LPT1 (DEV1 renamed) ----------------------------------- Primary GPIB Address 1 Secondary GPIB Address ........ NONE Timeout setting ............... T10s EOS byte ...................... 00H Terminate Read on EOS ......... no Set EOI with EOS on Write ..... no Type of compare on EOS ........ 7-bit Set EOI w/last byte of Write .. yes Repeat addressing ............. yes Device Unaddressing............ yes ----------------------------------- Note 1: 24 is the address used by HPPCLINK, the free file transfer software. This address setting seems to have no effect on the Paintjet. Note 2. This is the critical change needed for printing to Paintjet which is incompatible with having the HP computer on the same bus. Note 3. Although we have our GPIB board jumpered to use IRQ 5, disabling this IRQ here has no effect on either file transfer or printing. SUMMARY OF PROCEDURE Summary of Paintjet setup (assuming you are already loading GPIB.COM in CONFIG.SYS, e.g. "device=c:\gpib.com", for file transfer). 1. Address the Paintjet to 1. 2. Connect the PC GPIB card to the Paintjet with an IEEE-488 cable. 3. Disconnect the HP computer (if any) from the cable used in step 2. 4. Disable any LPT1 I/O hardware port in the PC. 5. Disable any "mode lpt1" redirection commands in your AUTOEXEC.BAT. 6. Run IBCONF, renaming DEV1 to LPT1 and changing 'system controller' to yes in GPIB.COM. 7. Reboot the PC. 8. Configure your software to use the DOS driver, not direct port I/O. 9. Test the printer, it should work now. RESULTS I've gotten the following to produce output on the PC->GPIB->Paintjet: DOS ^P to echo screen output to the printer COPY FILENAME LPT1: (where the file is text or graphics) Wordperfect 5.1 MFI Windows applications (notably WinMDI) Normally, with a graphics file, one should use COPY/B to force a binary copy. Bizzarely, however, this terminated on graphics files prematurely (usually its the other way around). Instead, COPY (without /B) sent out the whole file, but ALWAYS corrupted a portion of it. Therefore, if I have to send a graphics file to the printer, I use a small program I wrote in C, PRINTOUT.EXE, which uses a bdos(5, char) call (PRN:). This is about two-fold slower than going directly from Windows to the printer for reasons which escape me. I can make PRINTOUT.EXE available by anonymous FTP if you want it.