Data format

R

romain.alnet

Helo,
I am capturing data from COM1 on my terminal.
(I want a print to file for my mesure device, instead of printing the
data)
I think it is formated by one of these formats:
ESC/P
HPGL/2
PCL

Can anyone tell me how to know which of this formats is it and any
software to read this data under Windows.

Many thanks

roms
 
D

Don Phillipson

I am capturing data from COM1 on my terminal.
(I want a print to file for my mesure device, instead of printing the
data)
I think it is formated by one of these formats:
ESC/P
HPGL/2
PCL

Can anyone tell me how to know which of this formats is it and any
software to read this data under Windows.

HPGL and PCL are printing formats but most Windows
printers do not save output files to disk in these formats:
HPGL and PCL merely identify the rules the formatter
follows before sending a document to the printner.

We do not know what a "mesure device" may be.
You may be able to meet your needs by using Windows
to create a new printer, Print to File, type Generic.
This generates an ASCII file of type PRN that Wordpad
or Notepad (or any DOS text editor) can display.
 
B

Bob Headrick

Helo,
I am capturing data from COM1 on my terminal.
(I want a print to file for my mesure device, instead of printing the
data)
I think it is formated by one of these formats:
ESC/P
HPGL/2
PCL

Can anyone tell me how to know which of this formats is it and any
software to read this data under Windows.

Try opening the file in notepad. PCL files will have commends of the
form "?&k1L?(3X" where "?" is the escape character). Maybe
recognizable by lots of escape and & characters. HPGL/2 will have
commands like "IN;SP1PA10,10;", basically a lot of two letter commands,
a few numbers and commas separated by semicolons.

If you post a line or two of the file here someone could probably tell
you what you have. As far as reading the data, in PCL the data would be
in plain text with formatting commands before and after. HPGL would be
a bit more problematic, as often the data is represented in pen strokes.
Converting this back to text may be difficult....

Let's start with figuring out the format, it should be easier from there
to at least understand the magnitude of the problem.

Regards,
Bob Headrick, MS MVP Printing/Imaging
 
W

Warren Block

I am capturing data from COM1 on my terminal.
(I want a print to file for my mesure device, instead of printing the
data)

Details needed: brand and model of the measuring device. Was it
connected to a printer before? If so, what brand and model of printer?
I think it is formated by one of these formats:
ESC/P
HPGL/2
PCL

Put a copy of a sample file on a web page somewhere, and post a pointer
to it.

Failing that, run the Unix "file" command on it.
Can anyone tell me how to know which of this formats is it and any
software to read this data under Windows.

Hard to say without a sample. The data might be text, a bitmap, or a
vector-based drawing.
 
R

romain.alnet

Helo there,
many thanks to all these answers.
So let me give you further informations,
When I said measuring device, I meant an external device.
It is a medical device:
Huntleigh Fetal Dopplex II.
It has an RS232 connector out to a Printer called Dopplex Printa, in
fact it is a Seiko DPU-411-043.
What I want is, to print from my Dopplex II to file(over COM1 of my
computer) instead of printing on the DPU-411.
From another board they told me it was Epson : ESC/P.
Now if we assume that it is ESC/P how am I able to convert my captured
RAW data to a readable file.
Any software, or better, programming library for C or Java to do this
task will be welcome.

Many thanks,
Romain
 
W

Warren Block

Helo there,
many thanks to all these answers.
So let me give you further informations,
When I said measuring device, I meant an external device.
It is a medical device:
Huntleigh Fetal Dopplex II.
It has an RS232 connector out to a Printer called Dopplex Printa, in
fact it is a Seiko DPU-411-043.
What I want is, to print from my Dopplex II to file(over COM1 of my
computer) instead of printing on the DPU-411.
Now if we assume that it is ESC/P how am I able to convert my captured
RAW data to a readable file.
Any software, or better, programming library for C or Java to do this
task will be welcome.

Well, there's this:

http://www-md.e-technik.uni-rostock.de/ma/gunther/gs/upd/escp2ras.c

But it may make some assumptions about the input. We still don't know
whether the files contain bitmaps or escape-coded text.
 
R

romain.alnet

Hi Warren,

Many thanks for this information.
I have uploaded a zip file here:

http://bbcproject0.tripod.com/files/data.zip

It contains 2 files:
One is a scanned image of an example of the output of my printer
the other one is an example of escp captured raw data.
Maybe you can have a look on them and tell me more and what you think
about this.
The whole think is that I need to extract the differents values of the
plotted signal.
So I need to find a method to make a matrix to store the values of the
signal at each line. I think we need to use the the scale printed the
one ranging from 60 to 210.
So I don't know exactly how to do this.
But if the raw data can be converted to an image this is accurate with
the printed stuff, then maybe with an algorith based on the pixels
position the we can find out the signal value.
If you have any Idea to help...
Many thanks,

Romain
 
R

romain.alnet

Hi Christoph,
Thanks for your answer.
In fact I have tried Printcapture.
The software fits almost perfectly my needs.
But there are two problems.
One, their is a little rendering bug, but I have contacted the software
devellopper and he is trying to find out how to correct that.
The second problem is that all this process is aimed to be done on a
PDA.
So printcapture will not run on windows mobility.
So I am still working on a solution.
It is sure that if printcapture could run on PDA then it fits 100% my
needs
And I still need to find out a method to extract the graph values,
because this is the whole thing, getting the values of the plotted
signal.

Romain
 
C

Christoph Lindemann

Well, if the project is to extract the graph data, you could take a look at
the ESC/P documentation. If you have some understanding of programming for
your PDA, it should not be that complicated.
The doppler thingy produces rather simple ESC/P, and you need just to parse
a few commands, as the printing problably is almost hardcoded into.
The graph is sendt to the printer as a simple bitmap (ESC L: Select 120-dpi
graphics).

You find information about ESC/P here
http://undocprint.printassociates.com/formats/page_description_languages/esc_p2
 
W

Warren Block

Hi Warren,

Many thanks for this information.
I have uploaded a zip file here:

http://bbcproject0.tripod.com/files/data.zip

It contains 2 files:
One is a scanned image of an example of the output of my printer
the other one is an example of escp captured raw data.

The header is text, but the chart is bitmap data.
The whole think is that I need to extract the differents values of the
plotted signal.
So I need to find a method to make a matrix to store the values of the
signal at each line. I think we need to use the the scale printed the
one ranging from 60 to 210.

You'll have to render the bitmap and then scan for pixels. If the scale
changes, reading it may be tricky. Easier than OCR because the pixels
will always be in the same place, but similar.

The border lines can be trimmed, and the axes can probably be xored
out to avoid wiping out the signal pixels.

After all that, the signal pixels should be available just by looping
through the lines of the graph.
 
W

Warren Block

Hi Christoph,
Thanks for your answer.
In fact I have tried Printcapture.
The software fits almost perfectly my needs.
But there are two problems.
One, their is a little rendering bug, but I have contacted the software
devellopper and he is trying to find out how to correct that.

This may also be of interest:

http://www.kilgus.net/qpcprint/
 
W

Warren Block

Hi Warren,

Many thanks for this information.
I have uploaded a zip file here:

http://bbcproject0.tripod.com/files/data.zip

It contains 2 files:
One is a scanned image of an example of the output of my printer
the other one is an example of escp captured raw data.
Maybe you can have a look on them and tell me more and what you think
about this.

An interesting development. Some web searching yielded this:

http://groups.google.com/group/comp.sources.misc/msg/212530d776b1d9c3?dmode=source&hl=en

Copies of the two files can be found on numerous FTP sites.

epsonps compiled and ran on your test file, producing PostScript output
which I then converted to PDF with Ghostscript. The PDF is okay,
although I not sure if the graph is correct. It's not the same data as
in your jpeg.
 
R

romain.alnet

Hi Waren,

Thanks for all this answers.
Well, I've been trying the different solutions (QPC and Printcapture)
and works but with some display bugs that do not allow me to implement
a method to extract the values.
I didn't manage to make work the escp2ras.c (It compiled under C++
builder) but says that the input isn't good.
I tried like this: c:\...\escp2ras inputData.log OutputRaster.ras , but
with no chance.
I will try the epsonps file you found. Maybe this one can solve my
problem. By the way it is normal that the graph is not the same, in the
zip file, the scaned image is from another aquisition test than the log
file, so this is normal.
Con you please post your output pdf file or send it to
(e-mail address removed)
I am also looking around the GutenPrint project which seems to have an
utility called unprint that, maybe, can also work.
 
C

Christoph Lindemann

Romain,

I do not understand why you want to use all kind of big libraries, the
easiest way to get the path is just to parse the data yourself. By
converting it to image, postscript or whatever, just adds to the complexity.

To extract the graph bitmap, you just have to read the text until the
"Select 120-dpi graphics" (ESC L) command. after that you can just read the
graph bitmap, which holds 1 pixel pr bit.
 
R

romain.alnet

Hi Christoph,

Well in fact I started writing some code in java to parse the file and
I detect the ESC L command.
So lets discuss on where I am stuck about parsing the file.
We have a dots on the values 120 and 160. every 2 lines.
the device sends this pattern:
(tab = tabulation, sp = space)
tab tab tab sp sp ESC L Command for 120 dot tab tab sp ESC L Command
for 160 dot
To print the signal the device sends spaces, tabulations and ESC L
commands.
But things are more complicate some times because we have have more
than one pixel on a line.
etc....
So my problem is parsing this file from tabulations, spaces and esc L
commands how can I know helping me with le line with the scale to know
for example
if pixel drown with esc l command repremsents the value 142BPM in fact
(Values 60 to 210 are in BPM).
I am not at easy with this codes, so I don't exactly know how to found
the converstion method from the tabs, spaces and ESC L.

Maybe with this information you can give me a piece of information than
can help me to solve this.

In fact the problem is how to make a conversion to find the value from
the pixels position from the number of spaces and tabs and I also don't
get how exactly the Esc L command works.

Romain
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top