Printing gibberish may be a sign that one or more settings may be incorrect, potentially the databit, parity, or stopbits. Have you tried doing a similar setup in HyperTerminal?

David Ressler wrote:
Here's what prints gibberish:

use Win32::SerialPort;
$port=new Win32::SerialPort('COM2') || &syserr($^E);
$port->databits(8);
$port->baudrate(9600);
$port->parity("none");
$port->stopbits(1);
$port->write("Hello, world!\n");



----- Original Message ----- From: "Foo Ji-Haw" <[EMAIL PROTECTED]>
To: "David Ressler" <[EMAIL PROTECTED]>
Cc: <Perl-Win32-Users@listserv.ActiveState.com>
Sent: Sunday, March 12, 2006 11:32 PM
Subject: Re: Driving a POS printer from Perl


David Ressler wrote:
Thanks for the start.

I managed to get Win32::SerialPort to wake up the printer but it's printing
gibberish. I'm setting it to the same baud rate, etc., as the (functioning)
"Generic / Text" printer that I set up using the Windows "Add Printer".

Do you have any code snippits that would suggest things to try? The
documentation has way too much information for me to comprehend. I'm using the
module in another application to drive a modem and it works fine with only two
lines of code. Is this more complicated?

Check your parity and bit length. There is a DIP switch that determines
whether it's 8-bit or 7, even parity or odd. Maybe you can post your
working code for the community to inspect.


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to