Ports
May 19, 2013, 10:55:20 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: SMF - Just Installed!
 
   Home   Help Search Login Register  
Welcome to the PORTS Forum. Please post your questions, answers, and comments relating to USB and other hardware interfaces in the appropriate forums below. - Jan
Pages: [1]
  Print  
Author Topic: Parallel port problem  (Read 1888 times)
tomkin
Member
*
Posts: 1


« on: May 03, 2011, 08:30:24 am »

I have got a problem trying to use the parallel port and hope you can help me.

I am writing a program for a cinema using Python. Everything is working already, but there is one unsolved problem - I have to make the dot matrix printer print the tickets, which does not work

After days of searching for a solution I came across your site and inpout32.dll, which I installed. I took the Python sample program written by Lawrie Abbott which I found at http://logix4u.net/

I modified the program and tried to print out the smilie sample of this ESC/P site:
http://de.wikipedia.org/wiki/ESC/P

The code for it is written on top to the "Weblinks" of that page.

This is the Pytho code:

============
import ctypes

read = []
for n in [27, 42, 5, 24, 0, 0, 7, 15, 31, 62, 124, 120, 113, 241, 225, 224, 224, 224, 224, 225, 241, 113, 120, 124, 62, 31, 15, 7, 0, 13, 27, 74, 24, 27, 42, 5, 24, 0, 255, 255, 255, 129, 0, 0, 0, 195, 195, 195, 1, 1, 1, 1, 195, 195, 195, 0, 0, 0, 129, 255, 255, 255, 13, 27, 74, 24, 27, 42, 5, 24, 0, 0, 224, 240, 248, 124, 62, 30, 142, 143, 199, 199, 199, 199, 199, 199, 143, 142, 30, 62, 124, 248, 240, 224, 0, 13, 27, 74, 24]:
    ctypes.windll.inpout32.Out32(0x37a, 1)
    ctypes.windll.inpout32.Out32(0x378, n)
    read.append(ctypes.windll.inpout32.Inp32(0x378))
    ctypes.windll.inpout32.Out32(0x37a, 0)

print (read)
============

All data sent out is read correctly by Inp32. But the printer doesn't do anything.

I hope you can give me any tips, what I (or the OS - Win XP) do wrong. I am grateful for any help!
Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1625


WWW
« Reply #1 on: May 03, 2011, 10:59:15 am »

Be sure you're using the printer's port address as listed in Device Manager.

In the system BIOS, set the printer to SPP mode.

Try printing a few lines of text (ASCII characters) instead of a bit image.

Jan Axelson
www.Lvr.com
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!