Need to write a character directly to LPT1 port

User avatar
Biel EA6DD
Posts: 680
Joined: Tue Feb 14, 2006 9:48 am
Location: Mallorca
Contact:

Post by Biel EA6DD »

Look for LPT_timeout in the registry(HKEY_LOCAL_MACHINE,SYSTEM,ControlSet001,control,WOW). Try to set to 1 or 2, this may help in reduce the waiting time.
Saludos desde Mallorca
Biel Maimó
http://bielsys.blogspot.com/
User avatar
Rafael Clemente
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain

Post by Rafael Clemente »

Biel:
Had the value 15. Changed it to 1 but still not much difference.
Gracias por la idea!
Rafael
User avatar
tnhoe
Posts: 83
Joined: Tue Nov 08, 2005 11:09 am
Location: Malaysia
Contact:

Post by tnhoe »

or try BuildCommDcb( "LPT1:", @cDcb )
or try BuildCommDcb( "LPT1:9600,n,8,1", @cDcb )

By right we don't need the baud rate for LPT1.

Check also if the delay happens on SetCommState(), msgwait(), etc.
Try to remove the line causes delay.

Check also if anti-virus software causes the delay.

I used to print to 4" receipt printer without problem in FW195.
Never try with XP
Regards

Hoe, email: easywin3@yahoo.com
User avatar
tnhoe
Posts: 83
Joined: Tue Nov 08, 2005 11:09 am
Location: Malaysia
Contact:

Post by tnhoe »

may be for LPT1 we only need :-

opencomm()
writecomm()
closecomm()
Regards

Hoe, email: easywin3@yahoo.com
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Try this. Select Start-Printers and Faxes, then right-click on the print driver and select Properties then the Advanced tab. Select "Print directly to printer." This by-passes the spooler.
User avatar
Rafael Clemente
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain

Post by Rafael Clemente »

I sent the board to the factory for checking and I got it back with a note saying that it works Ok, but only under W98 and Me.

I was testing it with W2000 and Xp. Tried all the suggestions by Enrico, Thnoe, Randal, Biel and James. None of them worked which is not surprising after reading the note the manufacturer included.

What I can not imagine is why a simple paralell port board should not work under Xp... Any explanation?.

I guess I will set up an old W98 and try the damn board with it. In the meanwhile, thanks to all of you for your help and support.

Rafael
sildata
Posts: 38
Joined: Thu May 11, 2006 7:41 pm

SALUDOS ENRICO

Post by sildata »

Enrico: Has una prueba sencilla y elemental, bootea con un diskete de algun sistema operativo MS-DOS cualquier version que tengas, enseguida redirecciones el puerto "MODE LPT!=com1" A partir de alli cualquier instruccion que tipees por el teclado se emprimira por el puerto com1.
quizas esto te sonar un poco confuso, pero si no has solucionado todavia tu problema enviame un mensaje a mi correo y con gusto te enviare las instrucciones con mas exactitud, con esta prueba lo que consigues es verificar que los puertos de la computadora y el impresor inclusive el cable esta en operativos y en buen estado.
Saludos RODOLFO

sildata@cantv.net
User avatar
Rafael Clemente
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain

Post by Rafael Clemente »

Rodolfo:
Ya lo solucioné: Cambié la placa de relés controlada por puerto paralelo por otro modelo, controlado por puerto serie. Hice un par de correcciones al programa y funcionó a la primera.
Saludos,
Rafael
User avatar
Badara Thiam
Posts: 160
Joined: Tue Oct 18, 2005 10:21 am
Location: France
Contact:

Post by Badara Thiam »

I need just to send one ASCII character to LPT1 to activate the desired relay. The problem is that I can not find how to do it:
You can also try this command DOS :

copy MyAscCar.tmp lpt1.bmp

Regards, :wink:
Badara Thiam
http://www.icim.fr
Post Reply