Hi list.
I need to do a little program, to test if a cash drawer opens correctly from a Ticket printer.
With some code evaluated from a workspace is enough.
Somebody can light my way, how to send scape codes to a port? (COM, LPT, USB etc.)
Thanks in advance.
On Wed, Mar 11, 2009 at 10:30 AM, Giuseppe Luigi Punzi glpunzi@lordzealon.com wrote:
Somebody can light my way, how to send scape codes to a port? (COM, LPT, USB etc.)
If you understand Java, you can have a look at the attached file which controls the printer screen.
Java and me..we are enemies hehehe
I'm trying to use Smalltalk for all on my company.
Well, I know the escape codes, I only need to know, how to send it to LPT1, or COM2, or to a printer at USB.
It suppose, I need to sent to the printer port : ESC p 0 25 250
This, sends the signal to "electrify" the port at the printer, to open the cash drawer. This printers doesn't has screens.
Cheers.
Damien Cassou escribió:
On Wed, Mar 11, 2009 at 10:30 AM, Giuseppe Luigi Punzi glpunzi@lordzealon.com wrote:
Somebody can light my way, how to send scape codes to a port? (COM, LPT, USB etc.)
If you understand Java, you can have a look at the attached file which controls the printer screen.
On Wed, 11 Mar 2009 11:48:27 +0100, Giuseppe Luigi Punzi glpunzi@lordzealon.com wrote:
I'm trying to use Smalltalk for all on my company.
Well, I know the escape codes, I only need to know, how to send it to LPT1, or COM2, or to a printer at USB.
It suppose, I need to sent to the printer port : ESC p 0 25 250
This, sends the signal to "electrify" the port at the printer, to open the cash drawer. This printers doesn't has screens.
Talking through a serial port is pretty simple.
serialPort := SerialPort new baudRate: 9600; dataBits: 8; stopBitsType: 1; parityType: 0; yourself.
((serialPort openPort: self serialPortNumber) isNil) ifTrue: [ self error: 'COM port not available' ].
serialPort nextPutAll: #(1 2 3) asByteArray. serialPort close.
That setup does standard 9600 baud, 8n1.
Later, Jon
-------------------------------------------------------------- Jon Hylands Jon@huv.com http://www.huv.com/jon
Project: Micro Raptor (Small Biped Velociraptor Robot) http://www.huv.com/blog
squeak-dev@lists.squeakfoundation.org