Printer as chart recorder

M

Thread Starter

Mshtak

I have a spare printer and would like to use it as chart recorder to record analogue output (4-20mA) from instrument. Can anyone help me to find/build an economical Analogue to Digital convertor device and what else I need to run the paper feed at corresponding speed.
Thanks for ur time
 
D

David Wooden

I think you two should talk!


In "APPS: 8052 designing project" ( "http://www.control.com/1026149503/index_html":http://www.control.com/1026149503/index_html ), Eng. Aladdin Eid wrote:

>hi all
i am a communication and electronic engineer students in my 4th university year. i am working in a 8052 micro-processor based project. i
would like anyone to tell me an idea or a problem he\she faced in real life that can be solved by the 8052 and i will be happy to help him\her i will make the whole project at no cost and will send u results.<
 
C

Curt Wuollet

I have done this also as part of the Worlds Cheapest Temperature recorder described in a previous post on home hvac control. Once you
have the four channels of data from the thermistors on the joystick port, you need carnal knowlege of your printer. Most used to come with
this data but since computers have been dumbed down, very few people besides driver writers use the raster graphics capabilities. They are very printer dependent with Epson having made an effort with their escP2 command set to standardize theirs. The quick tour is that you
allocate a 2 dimension line buffer array. If your printer can print a single row of dots and microstep, this becomes trivial. If it can't you build a line of the printer's native cells and write it when you have a full line. This is usually done in either case with escape codes.
You send escape codes to set it up, write the data, and then usually a terminating sequence. A nice effect is to have the graphics version on the screen and write what falls off the end to the printer. I may still have some code around for Epson dot matrix printers or maybe even an escP2 compatible inkjet but it would take a while to lay my hands on it. I did it in Turbo Pascal and then rewrote it in C but both were many, many, moons ago under DOS. It might be on 5.25" 360k floppies in the dungeon. I skipped Windows but they must have libraries with this capability now that they have printers that are totally
useless without Windows. For examples for a vast array of printers, download Ghostscript. What Ghostscript does is interpret Postscript and render it in the native graphics mode of non-postscript printers. The source for the drivers should tell you how to do graphics on any of the supported printers. I'm sure someone else has done this so you might try the big shareware archives as well. You can make a very useful 4 channel temperature recorder with just 4 thermistors and a PC with a printer. If you need other analog quantities you'll need a daq card. Boondog automation has an example of a simple A/D
if you want to build one. Someday when I'm bored I'll recreate this project under Linux and put it up someplace.

Regards

cww

cww
--
Free Tools!
Machine Automation Tools (LinuxPLC) Free, Truly Open & Publicly Owned Industrial Automation Software For Linux. mat.sourceforge.net.
Day Job: Heartland Engineering, Automation & ATE for Automotive Rebuilders.
Consultancy: Wide Open Technologies: Moving Business & Automation to Linux.
 
Curt:
> Once you have the four channels of data from the thermistors on the joystick port, ...
> If your printer can print a single row of dots and microstep, this becomes trivial. If it can't you build a line of the printer's native cells and write it when you have a full line.<

Note that these days a lot of printers are page-oriented, which means you'll have to print the chart a page at a time. This has the disadvantage
that there's more data in the computer, where it can be lost through a power failure or crash, but otherwise it becomes much simpler.

Probably the easiest way is to run the data through gnuplot using a batch file or two (script, if you're in linux). gnuplot can be driven from text files, which makes integrating it into other programs a snap. Just write a VB / Perl / Python script to write the values to a file, and call gnuplot to convert it to a graph and print it (or output an image). If necessary,
use ghostscript for the printing (more printers, more image types, PDF).

> Someday when I'm bored I'll recreate this project under Linux and put it up someplace.<

We should probably want it for the MAT project :)


Jiri
--
Jiri Baum <[email protected]> http://www.csse.monash.edu.au/~jirib
MAT LinuxPLC project --- http://mat.sf.net --- Machine Automation Tools
 
Top