HP 600 Series DeskJet Interface =============================== copyright 1998 by Lawrence McClafferty Disclaimer: ---------- Use this software at your own risk! All attempts have been made to ensure that no smoke is released from any components in your computer equipment as a result of using this software. There are NO disk drive writes of any kind (ie. floppy, hard drive, etc.) performed by this software so it should not create any new wild and wonderfull files on any of your drives. Contents -------- 1. What is this thing anyway? 2. Software/Hardware requirements 3. Registering DJIface and reporting bugs 4. Running DJIface 5. Description of commands and such 6. Sending preset commands to the printer 7. DJIface History 8. Things to do in the future 1. What is this thing anyway? DJIface stands for DeskJet Interface. When I first purchased my HP DeskJet 690C printer I browsed through the user manual to see what all the beast could do. That took a whole 3 1/2 minutes since, as you know, the manual is not the thickest book in the world. I then proceeded to browse through the disks which accompanied the DeskJet. Between the manual and the disks I coud see there was a pretty spiffy user interface available for an IBM (or IBM clone) type of machine. There was nothing for an Amiga user though. I have tinkered around with programming in the past and since I have gotten into dabbling in C in the past few years I thought I would take a crack at writing something for myself. When you run DJIface you MUST keep in mind that programming is not my field of work (actually I am a flight simulator technologist handling all the hardware associated with a CC130 Hercules flight simulator). Therefore, I will appologize now for what some people will probably say is pretty poor programming work. Oh well, can't keep everybody happy. By the way, any spelling mistakes you may find in DJIface or in this manual have been placed there on purpose just to keep those people happy who make a point of looking for errors like that ;) No?? Ok but that's my story and I'm sticking to it. 2. Software/Hardware requirements I suppose I should say something more here than just, "Hey, you need an Amiga and an HP 600 series DeskJet printer" so here goes... You will need an Amiga, an HP 600 series DeskJet printer and a cable to connect them together... :-) I'll list the various systems DJIface has been run on. If your system is different than what is listed here then please let me know and I'll add more to the list. DJIface has been tested with: Amiga 2000 - with Vector 68030 25mhz, Workbench 3.1 Amiga 2000 - with VXL030 25mhz, Workbench 3.1 Amiga 2000 - stock machine, Workbench 2.1 HP DeskJet 690C HP DeskJet 695C HP DeskJet 855C - NOTE: even though DJIface has been aimed specifically at the HP 6xx series of printers, most control codes sent to a DeskJet are the same. Some of the control codes for the 8xx series may be different or missing. NOTE: a complete list of what control codes are possible for the various DeskJet printers can be found on the HP web site (www.hp.com at the time of this writing). 3. Registering DJIface and reporting bugs DJIface is being released as shareware. The demo copy is fully functional. It is NOT crippled in any way, shape, or form. The only difference you will find between the demo copy and a registered copy is your name will appear on the registered copy (wahoo eh?). The registration fee is only a measly $2.00 US if a registered copy can be sent to you via email or $3.00 US if you require a registered copy mailed to you on floppy. Any floppy orders will be mailed on a standard low density (880k) 3.5" floppy disk. Users who opt for the email method of delivery will receive future updates of DJIface automatically as they are (or if they are) produced. Users who require the program be mailed to them on floppy can receive updates at the cost of $1.00 US per update (basically to cover the cost of the floppy and the postage). Users requireing updates on floppy will not automatically receive them, they must be requested. Only the email method of receiving updates will be automatic unless you tell me that you do not wish to receive updates. Payment may be made in the form of a money order or cash. Personal checks will not be accepted. If you find a bug running loose then please let me know so I can correct it. If you have an idea of something extra you wish to have added to DJIface then please let me know. Keep in mind though that programming isn't my line of work so there may be some things I just can't do due to lack of experience. I can be reached in one of the following ways: By mail : Lawrence McClafferty 519 Lester Road, RR #5 Trenton, Ontario, Canada K8V 5P8 By email : lmcclaf@sympatico.ca ICQ : 17624142 I also run an Amiga BBS using software of my own design programmed using GFA-Basic. The software is named TeleFun BBS. The name of my BBS is The Black Box and the number is (613) 394-0651. 4. Running DJIface Running DJIface should be pretty straight forward. Just double click on its icon from the Workbench or type the name DJIface from the shell. DJIface expects to be able to run in a 640 x 400 window on the Workbench screen. Therefore, if you have your Workbench screen open as a 640 x 400 or larger then everything will look all nice and 3D just like your Workbench. However, if your Workbench screen is open as only a 640 x 200 then DJIface will open its own 640 x 400 screen and then open its window on that screen. You will lose the nice 3D look of the gadgets though. The program is completely run using gadgets. Just point and click on what you want to do. The command will not be sent to the printer until the checkbox gadget is selected for that command. The checkbox will remain checked until that command is altered in some form. Each time the checkbox for a command is selected, the appropriate command will be displayed in the lower right hand Status Bar. This way you can copy down that command if you wish to embed it within your text documents. Please note that the command will start with ESC. This stands for the escape code which is decimal 27 or hex 1B but since that character is not a standard printable character I used ESC to display it. Each command description will be explained (or attempted to be explained) in the next section. 5. Description of commands and such I don't think it is really required to go into detail about what each of the commands would do since the commands would be covered in operating manuals for the various printers. I have no idea of what the "Display Functions" command is supposed to do though so if someone would care to enlighten me I would greatly appreciate it. For now I will describe a couple of the gadgets located on the lower right hand corner of the window. Print: Test - you have the option of sending two different test lines out to the printer. The lines are as follows: Test 1 - this line is basically 80 numbers in one line. 12345678901234567890123456789012345678901234567890123456789012345678901234567890 Test 2 - this line prints all upper case letters, various symbols and numbers. ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()-_=+\|/?.>,<;:'[{]}`~1234567890 Print: File - you can also send a file directly to the printer with the "Print PAR:" and "Print PRT:" gadgets. The PAR: port will handle stuff in an unformatted manner. In other words, the printer will not add in carriage returns at the end of a line unless the printer has been told to do a CR and LF. On the other hand, the PAR: port is where you want to send the commands to so special things. If you happen to examine the disks (or CD) that came with your DeskJet printer you will find some alignment files (on my disks they are called: ALIGN1.DAT, ALIGN2.DAT, ALIGN3.DAT, ALIGN4.DAT, ALIGNBOX.DAT, and ALIGNPAT.DAT). These files can be copied to to PAR: port to perform the alignment tests. If you have used CMD to redirect your printer output to a file (see your TOOLS drawer on your Workbench disk) you will have a file that can be copied to the PAR: port in the same way as the alignment files. The PRT: port will format the text properly for you so you will get the proper carriage returns and linefeeds when you print a plain text document. Use the "Print PRT:" when dumping a plain ASCII (text) file out to your DeskJet. Now you can see why I put the option of printing a file to two different places. Whether you select PAR: or PRT: you will get a standard ASL requester so you can pick the file you want to dump out to the printer. Instead of opening a file and reading the stuff in and then opening the printer and sending stuff out, I just used the "copy ??? to XXX" command where the ??? represents the file you have selected and XXX represents either the PAR: or PRT: port. If you have started DJIface from the Workbench you will not be shown any errors if things are not working right. If you are not getting your printout then try closing DJIface and running it from a shell (open a shell, cd to the directory where DJIface resides, and type in "run DJIface"). Now you can view any errors in the shell window you started DJIface from. Reset - this option will send the reset command to the printer. At the same time it will reset any of the settings you have specified through the DJIface program. Self Test - this option prints out the diagnostic page of the printer. NOTE: you can also issue this command without the use of any program. Hold the power button on the front of the DeskJet and press the resume button 5 times. Printer Open - this opens a channel to the PAR port. A printer will not accept commands if the PRT port is used. This is a handy thing to remember if you wish to embed any of the commands within your own text documents. Fake Open - you do not need to have the printer in use to see what the commands would be. This gadget makes DJIface think the printer port is open so it will still show you the commands. None of the commands are actually sent to the printer though. Status Bar - this bar will show you any errors you may experience or the command that would be issued to the printer for the feature you select. NOTE: you can tell the DeskJet to do certain test just with the use of the power and resume buttons on the front panel of the DeskJet. These tests are: Printing Self Test - press and hold down the resume button for a few seconds. When the printer begins to print release the resume button. Continuous Self Test - this is the same as the Printing Self Test except it will not stop until the printer power is turned off. Press and hold the power button. Press the resume button 10 times. Diagnostic Test - press and hold the power button. Press the resume button 5 times. Clean Test - press and hold the power button. Press the resume button 7 times. 6. Sending preset commands to the printer You may wish to create some files of commands that you use quite often. DJIface is great for showing you exactly what command string is required to be sent. You can then make a one line text file stored on disk which can be sent whenevr you need them. For example, I keep two text files on disk. One is called "prtnormal" and the other is called "prtsource". The prtnormal file looks like this: ESCEESC(s1PESC&s0CESC&a10L That is just a single line in a text file stored on disk. Please note that I have used ESC to represent the escape character. The actual text file I have on disk uses the true escape key in place of the ESC. I send this file to the printer with the following command from my shell: copy prtnormal to par: That will tell the printer to set itself up the way I want it when I issue commands from my shell such as "dir >prt: dh0:" or "type >prt: stuff.txt". The other file prtsource looks like this: ESCEESC(s22h8v0PESC&a15LESC&s0C I send that to the printer with the command copy prtsource to par: from my shell to tell the printer to set itself up for when I dump my source code out to my printer. This line will tell the printer to use condensed type of print so I can get more info on one line. Some of my source code tends to be a litte large so I needed to try saving paper a bit. NOTE: before I send any command of my own to the printer I always send the "initprinter" command from my shell. This will initialize the printer with the info you have set in your printer prefs from workbench. 7. DJIface History 1.0 - October 11, 1998 - Initial release, go ahead folks and flame away. I'm listening. 1.1 - October 19, 1998 - bug fix - if the fake par was open and you tried to open the real par you would get the error saying par device could not be opened but the checkmark would appear beside the real par. The fake par is now properly closed and the real par is properly opened if you try to open the real par while the fake par is open. - the integer gadgets initially start with a value of zero but that value was not sent to the printer if that command was selected. It is now sent properly. NOTE: the zero values that DJIface starts with are not proper values, they are just zero to show a value. - File Print option added. You will notice two new gadgets near the TEST1 and TEST2 gadgets. The "Print PAR:" gadget will copy a file you select to the PAR: port. The "Print PRT:" gadget will copy a file you select to the PRT: port. - removed the checkbox checkmark if command was sent to par: (real or fake) and the par: was not open. 8. Things to do in the future Not too much to add to this list just yet. I'll throw some stuff in here when comments are received from other users. - get printer info from printer.prefs to be loaded as default data. - draw up a nice icon for the program. - add in the raster graphics options.