Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printer issues

Status
Not open for further replies.

BobDavis

Programmer
Sep 7, 2003
37
US

This may be more of a printer than a Foxpro issue, but I think the legacy crowd here is more qualified to answer this than those in some printer forum.

My FPD 2.6 procedures are full of CHR() printer codes to use with my Brother HL-660 laser parallel (LPT1) printer set to Epson FX-85 emulation. I have one in use and another spare and although they've been very reliable are getting old, now about 15YO. They do what I need for a Foxpro printer, and I doubt if a newfangled USB printer is capable of working with these codes. If it was printing only text I could use one of the spooler programs mention in earlier threads here, and I've tried NET USE LPT3: \\OFFICE\EPSON in an effort to send printer commands to my USB inkjet, but it comes back saying the device is already in use, which it isn't. There are numerous laser printers on the market with Epson FX emulation, and I would like some pointers if anyone has gotten any of these to work with the coding I have.

The problem I'm having now is that whenever I use the present laser printer for Windows functions (Word, Firefox, etc.) it fowls up the configuration and subsequent printing in Foxpro does not render ASCI characters as specified in the coding. I get text but other characters like borders are nonsense characters. If I turn the printer off, then on again it corrects itself, and if I let it sit in sleep mode for a while it will also reset.

Does anyone know why this is happening or how to correct it short of turning the printer off or waiting for it to sleep for a while?

I could buy another laser and use it only for Windows printing, then use the old laser exclusively for Foxpro. That would clutter the office even more than it is and isn't an elegant solution.
 
Fox and printing, yep been there gotten the t-Shirt. However you have me on FPD 2.6 and moderm hardware (I wrote FPD back in the day but upgraded it to FPW when it came out. ) I wonder if there is some printer code that you can add to the FPD app that will force a virtual restart of the printer. It would of course slow down the printing process but that is a possibility.

Side comment:
I suspect that there are good reasons that the app has not been upgraded, but maybe a partial upgrade could be made. Here is what I am thinking. Just before getting to the section of the code that prints the reports save the report data to a file/database/table. Now create/run a new VFP app that spends it time looking every few seconds for new jobs to print. When it sees a record(s) for a print job from the DOS program the VFP app prints it with nice simple graphic lines etc. If you are lucky you can slowly sneak an upgrade in. (and I bet you are a ome person shop so there will be no sneaking <smile>)

Lion Crest Software Services
Anthony L. Testi
President
 
If your printer truly emulates the Epson FX-80 programming codes, then you should be able to send the INITIALIZE PRINTER (Esc @) command to re-initialize the printer and eliminate any previously sent commands.

Refer to: ftp://ftp.cise.ufl.edu/pub/mirrors/LPRng/RESOURCES/PPD/epson.htm
or
files.support.epson.com/pdf/fx80__/fx80__uv.pdf

If that should work, then you just Initialize before your FP printing and then again after printing.

As to: "I doubt if a newfangled USB printer is capable of working with these codes."

USB is merely one of the interfaces just like a direct network interface.
The printer 'engine' and its control language should not vary depending on the interface.
I'd check with a manufacturer prior to any purchase, but as long as the workstation can send 'raw' commands to the printer through any interface, then you should expect the same type of functionality.

Good Luck,
JRB-Bldr

 
I start every print job in FPD with an "initialize printer" command (CHR(27)+CHR(64)) and that doesn't help with this problem. So far only powering down then up again, or leaving it in sleep mode for a while (unknown period, but longer than one minute) straightens it out. Also, hitting the hardware "reset" button on the printer doesn't do anything either.

For the time being I've connected the printer power cord to a box with on-off buttons for each device. It's next to my chair, so before using FPD for printing I must think if I've printed to XP that day and if so I'll just power the printer on and off within a few seconds. Unfortunately when I do that it takes the printer several minutes to get functional again. Ah, the joys of using legacy hardware and software.
 
Are you sending the reset by @ x,y say chr()+chr()
or with '?' mark ?

I remember having problem by sending the code to the printer by @ say. Try sending codes by different method as you are using.

 
Try one of these reset printer codes (triple ??? bypasses screen formating and goes unformatted to printer):
??? CHR(27)+"@" && Epson-compatible (dot-matrix)
??? CHR(27)+"E" && HP-compatible (laser, etc?)
 
If a reset doesn't help, it may be that the conflict is that the "Symbol Sets" are being switched to/from IBM Layout and reset isn't changing that. If so, change Symbol Sets using another printer code:

CHR(27) + "(#" + cSymSet

where cSymSet is:
8U = HP Roman 8
10U = IBM Layout (code page 437)
12U = IBM Layout (code page 650) European
8M = Math 8
There are other codes, but these will probably be what you need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top