views:

218

answers:

6

We are making a lab instrument using an ARM9/RTOS system. The client has asked about printing simple reports from the ARM9 system. In this case, we have USB Host support in the RTOS. I'm thinking about printing bitmaps in generic PCL, hoping that will cover the widest range of printers. Is there a better way to approach this? I'm assuming the RTOS does not have printer drivers, and I don't want to support a lot of printers.

We also support USB device mode on our system, so you could plug in a photo printer, and our device would appear to be a USB stick. So that would work, but it's a bit clunky. This will be a C/C++ embedded system

A: 

If I understand you correctly, you could write a formatted text file and do a "print" command through Windows in the "usb stick" mode.

Paul Nathan
Sorry - should have been more clear. No Windows OS is running, just our embedded RTOS.
Jeff
Oooh, there's no connection to any desktop OS at all?
Paul Nathan
No - device sits on a lab bench
Jeff
A: 

For a simple report, it would be best to stick to straight ASCII. If you need some graphics, PCL would be a good choice for B/W laser printers, but I'm not sure how universal it would be for the more common ink-jet printers.

Edit: the PCL Reference Manual is available as a PDF from HP.

Mark Ransom
+3  A: 

Pretending to be a digital camera and interfacing with a PictBridge printer actually sounds pretty clever. It would remove the need to deal with different printer drivers, and if my understanding of the technology is correct, you could even control the operation of the printer right from your device.

On the other hand, as someone who has used a fair number of computerized lab instruments (oscilloscopes etc.) I find the ability to save screenshots from an ethernet/web interface to be much more useful. Print is dead.

Theran
Thanks - controlling the printer through PictBridge is a good idea
Jeff
A: 

PostScript is natively supported by most printers, so you could just send it over the wire, but it would be a lot more cumbersome than straight ASCII. There are libraries, but they're bulky.

Crashworks
+1  A: 

Have you looked at what all the scope vendors are doing? They all have print options (I think) and I don't know what they are doing to solve this problem.

Last time I was involved with something like this, we used serial ports to talk to HP printers using PCL. That backfired as everyone quickly stopped making serial printers!

Michael Kohne
Michael - what is a "scope" vendor? I'm thinking PictBridge solves the currnt problem, but we are still looking at doing PCL over USB, just to print bitmaps only.
Jeff
Michael Kohne
+1  A: 

Since your device can appear to be a USB stick, a simple solution would be to generate a report as a JPEG image and then have the printer open and print it. This way, the people who want paperless output can use the image as-is, and everyone else can print it.

Thanks - "have the printer open and print it" is the tricky part. Looks like PictBridge will allow this, that's the solution we are researching now.
Jeff