HardwareBanter

HardwareBanter (http://www.hardwarebanter.com/index.php)
-   Printers (http://www.hardwarebanter.com/forumdisplay.php?f=35)
-   -   Interfacing the printer port (http://www.hardwarebanter.com/showthread.php?t=187038)

David[_24_] November 30th 10 12:36 PM

Interfacing the printer port
 
Hi all,

My client has a device that prints to an Epson LX300+II printer. It is not a
computer, but an electronic measuring device.

I need to capture the data coming from the device.

The device output to the printer is using 11 wires, they are D0 to D7, GND,
Busy and Strobe, going into a regular centronics type connector into the
printer.

I have mapped all pins to their identical on the PC. I was initially
thinking a crossover like laplink, but realised that laplink uses 4 data
bits rather than 8, so was not suitable.

I am writing in C# and using inpout32.dll on Windows XP. My port is 0x378

I am having trouble when the device sends, to read it. At the moment, I have
a loop just monitoring what is on 0x378, but it is missing the whole
communication.

I think I need to raise the busy line (re-map it to a output control line)
but then how do I monitor the strobe? I think that needs to be mapped to an
input line... however, I need C# to be able to respond to the strobe as an
event. I have no idea how to do that...

Also, I am assuming that it is ascii data that is sent to the printer (ascii
on the data lines). Am I correct in this assumption?

Any help would be greatly appreciated.

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available



me November 30th 10 05:29 PM

Interfacing the printer port
 
On Tue, 30 Nov 2010 12:36:52 -0000, "David"
wrote:

Hi all,

My client has a device that prints to an Epson LX300+II printer. It is not a
computer, but an electronic measuring device.

I need to capture the data coming from the device.

The device output to the printer is using 11 wires, they are D0 to D7, GND,
Busy and Strobe, going into a regular centronics type connector into the
printer.

I have mapped all pins to their identical on the PC. I was initially
thinking a crossover like laplink, but realised that laplink uses 4 data
bits rather than 8, so was not suitable.

I am writing in C# and using inpout32.dll on Windows XP. My port is 0x378

I am having trouble when the device sends, to read it. At the moment, I have
a loop just monitoring what is on 0x378, but it is missing the whole
communication.

I think I need to raise the busy line (re-map it to a output control line)
but then how do I monitor the strobe? I think that needs to be mapped to an
input line... however, I need C# to be able to respond to the strobe as an
event. I have no idea how to do that...

Also, I am assuming that it is ascii data that is sent to the printer (ascii
on the data lines). Am I correct in this assumption?

Any help would be greatly appreciated.


Have you looked at the avaiable refes for this printer?
http://www.epson.com/cgi-bin/Store/s...odoid=63061037


Jeff Jonas December 1st 10 01:37 AM

Interfacing the printer port
 
My client has a device that prints to an Epson LX300+II printer.
It is not a computer, but an electronic measuring device.
I need to capture the data coming from the device.


This book is essential reading:

http://www.lvr.com/parport.htm
Jan Axelson's "Parallel Port Complete"
Programming, Interfacing, and Using the PC's Parallel Printer Port

It ought to clearly show
- how to use the PC's parallel port in 8 bit input mode,
accessing it via C# or other languages and operating systems
- how the printer normally handshakes
so you can tap the data by monitoring the data & strobe lines.

A "data logger" or logic analyzer may help
since they're external high speed devices that are now USB interfaced.

David[_24_] December 1st 10 10:45 AM

Interfacing the printer port
 
Thanks Jonas,

I had a look at the website and then followed the link to the codeproject
article. The codeproject C# article only demonstrates outputting on the
ports, however, I started reading the comments and one of the comments
linked to
http://moebiusit.com/blog/pabloroman...parallel-port/

I think this may do what I need...

If I move the strobe wire to a status line, I should be able to use the
strobe to "interrupt" the PC to be able to collect the data. It seems the
strobe line is an output line, I need to be able to respond to a strobe
rather than set it. It may not even need the strobe... I may be able to
respond to just the changes on the data lines, but I think that is risky.

Hopefully, my experimentation can be done from another computer set to print
to the same type of printer. The actual equipment is about 75 miles (1.5
hours drive) away and I don't have the internet access that I would use to
help me.

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available


"Jeff Jonas" wrote in message
...
My client has a device that prints to an Epson LX300+II printer.
It is not a computer, but an electronic measuring device.
I need to capture the data coming from the device.


This book is essential reading:

http://www.lvr.com/parport.htm
Jan Axelson's "Parallel Port Complete"
Programming, Interfacing, and Using the PC's Parallel Printer Port

It ought to clearly show
- how to use the PC's parallel port in 8 bit input mode,
accessing it via C# or other languages and operating systems
- how the printer normally handshakes
so you can tap the data by monitoring the data & strobe lines.

A "data logger" or logic analyzer may help
since they're external high speed devices that are now USB interfaced.




me December 1st 10 09:01 PM

Interfacing the printer port
 
On Tue, 30 Nov 2010 12:36:52 -0000, "David"
wrote:


Also, I am assuming that it is ascii data that is sent to the printer (ascii
on the data lines). Am I correct in this assumption?


Epson ESC/P language. Google it for PDF refs.

David[_24_] December 2nd 10 10:27 AM

Interfacing the printer port
 
Thanks,

Looking into it.

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"me" wrote in message
...
On Tue, 30 Nov 2010 12:36:52 -0000, "David"
wrote:


Also, I am assuming that it is ascii data that is sent to the printer
(ascii
on the data lines). Am I correct in this assumption?


Epson ESC/P language. Google it for PDF refs.




David[_24_] December 2nd 10 10:30 AM

Interfacing the printer port
 
Hi Jeff,

I have now come up with another problem here, perhaps you might be able to
enlighten me...

I am programming on a laptop, which does not have an LPT port. I bought an
Express card parallel port and was trying to interface directly to that.
However, it is not working.

I connected the card up to a laserjet to ensure that I had not blown the
card and that came up, but it came up as USB003.

Any idea how I might interact with the parallel port which is via a USB
(Actually, an express card that is showing as USB)?

Any help would be very much appreciated.

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available


"Jeff Jonas" wrote in message
...
My client has a device that prints to an Epson LX300+II printer.
It is not a computer, but an electronic measuring device.
I need to capture the data coming from the device.


This book is essential reading:

http://www.lvr.com/parport.htm
Jan Axelson's "Parallel Port Complete"
Programming, Interfacing, and Using the PC's Parallel Printer Port

It ought to clearly show
- how to use the PC's parallel port in 8 bit input mode,
accessing it via C# or other languages and operating systems
- how the printer normally handshakes
so you can tap the data by monitoring the data & strobe lines.

A "data logger" or logic analyzer may help
since they're external high speed devices that are now USB interfaced.




Jeff Jonas December 2nd 10 10:58 PM

Interfacing the printer port
 
My client has a device that prints to an Epson LX300+II printer.
It is not a computer, but an electronic measuring device.
I need to capture the data coming from the device.


I have now come up with another problem here,
perhaps you might be able to enlighten me...
I am programming on a laptop, which does not have an LPT port.
I bought an Express card parallel port ...
Any idea how I might interact with the parallel port which is via a USB


I'm afraid I've not yet programmed USB devices,
so I'm unusure you can guarantee the response time
without using some intelligence at the other end
such as microcontroller.

Perhaps a better approach would be to use a USB "Logic Analyzer"
or "data logger" to capture the data since that's their intended purpose.
A digital oscilloscope is overkill since you're capturing digital data.
This one is open source and rather affordable
and is on my "wish list" (I don't have one, yet)

http://www.sparkfun.com/products/8938

That ought to speed up your progress.
Keep us posted, for it's an interesting project you have on your hands.


David[_24_] December 3rd 10 02:53 PM

Interfacing the printer port
 
Hi Jeff,

I have an idea...

The logic analyser you suggest might take too long to get here (UK), plus it
is prob a little too much (overkill) for me.

I have been thinking laterally, I was trying to find things to do with
parallel ports, but coming stuck everywhere. I changed my search to home
automation usb and found a 16 line output, 16 line input device that will do
almost what I want. I spoke to the designer and the main issue would be the
strobe and the length of the pulse. The device can only poll down to about
20ms, where the pulse may only be 100us.

However, I remember from my early days of playing with computer control,
that I can use an octal latch. Feed the pulse straight into the latch and it
latches the data, while I am reading it, I send a busy. Now, that should
work all being well.

In my program, I will read the data in, then handle the data with a thread.
(I think I need to send the data to 2 files, one with the actual ascii text
and one with the numbers generated, where I can't see the actual text, I can
refer to an ascii chart to determine the numbers and control characters)

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available


"Jeff Jonas" wrote in message
...
My client has a device that prints to an Epson LX300+II printer.
It is not a computer, but an electronic measuring device.
I need to capture the data coming from the device.


I have now come up with another problem here,
perhaps you might be able to enlighten me...
I am programming on a laptop, which does not have an LPT port.
I bought an Express card parallel port ...
Any idea how I might interact with the parallel port which is via a USB


I'm afraid I've not yet programmed USB devices,
so I'm unusure you can guarantee the response time
without using some intelligence at the other end
such as microcontroller.

Perhaps a better approach would be to use a USB "Logic Analyzer"
or "data logger" to capture the data since that's their intended purpose.
A digital oscilloscope is overkill since you're capturing digital data.
This one is open source and rather affordable
and is on my "wish list" (I don't have one, yet)

http://www.sparkfun.com/products/8938

That ought to speed up your progress.
Keep us posted, for it's an interesting project you have on your hands.





Andrew Smallshaw December 5th 10 04:04 AM

Interfacing the printer port
 
On 2010-12-03, David wrote:

I have been thinking laterally, I was trying to find things to do with
parallel ports, but coming stuck everywhere. I changed my search to home
automation usb and found a 16 line output, 16 line input device that will do
almost what I want. I spoke to the designer and the main issue would be the
strobe and the length of the pulse. The device can only poll down to about
20ms, where the pulse may only be 100us.

However, I remember from my early days of playing with computer control,
that I can use an octal latch. Feed the pulse straight into the latch and it
latches the data, while I am reading it, I send a busy. Now, that should
work all being well.


That's the kind of thing you're probably going to need. I'd go
further than that: you're probably going to need the BUSY line
asserted in hardware until you de-assert it in software since you'll
never achieve the latency you need otherwise.

A year or two ago I built a serial to parallel converter that with
a couple of wiring changes to the printer port and new software
could be adapted to work in reverse - I'll send you my schematics
and code if you want. However, some commerically available converters
do that as standard, e.g. http://www.bb-europe.com/product.asp?SKU=232SPS2
For £80 I wouldn't think it worth assembling a unit and writing
new code.

--
Andrew Smallshaw



All times are GMT +1. The time now is 10:42 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
HardwareBanter.com