$PORT = "COM1"; # port to watch $ob = Win32::SerialPort->new ($PORT) || die "Can't Open $PORT: $!"; $ob->baudrate(1200) || die "failed setting baudrate"; $ob->parity("odd") || die "failed setting parity"; $ob->databits(7) || die "failed setting databits"; $ob->handshake("rts") || die "failed setting handshake"; $ob->stopbits(1) || die "failed setting stop bits";; $ob->write_settings || die "no settings"; # Send a hex string to the port my $sendP = pack('C*', 0x1b, 0x50); # the print command my $sendT = pack('C*', 0x1b, 0x54); # the tare command my $pass=$ob->write($sendP); sleep 1; my $result = $ob->input; print "result = $result\n"; undef $ob;