Programmers question regarding parallel ports...

wmrcomputers

Stafford PC & laptop repair specialist
I know there are quite a few programmers on here so want to know if anyone can produce a simple script or executable for Windows to solve this problem please...

I am using the parallel port to control the relays for my animated Christmas lightshow. No problem in that respect and i've got it all set up and working.
HOWEVER, Windows boots up with the the 8 data channels switched high / on / 5v or however you prefer to call it. This would mean that if the computer was restarted, ALL of my outside lighting will remain permanently lit until the lighting application takes over at it's preset time.

It's not a huge problem but I would have ideally preffered the lights to remain OFF until showtime. I can reset the data pins to off / low manually myself but is there a simple of way of getting Windows to turn them all off straight after booting up? Ideally a simple executable that could be set to start with windows or something like that would be ideal.

I don't want to take up hours and hours of anyone's time, but thought I'd ask incase we have a genius around here that could sort this out in a jiffy. ;)

Thanks
 

wmrcomputers

Stafford PC & laptop repair specialist
Wookie said:
A NOT gate for each wire?
Sounds along the right lines although I'm not into programming so wouldn't have a clue. All I know is that windows sends a HIGH signal to each data channel on the parallel on boot up, but then doesn't send a LOW signal to switch them off again. If I start the PC up with the power to the relay board turned on it causes them all to stay latched on until i run my lighting control software. If I leave the power to the relay board OFF and only switch it on AFTER the PC has booted then they remain off.

It's not an enormous problem like I said, it's just that I'd have liked to set it up so that if one of the kids knocked the PC power off, all that somebody (babysitters etc) would need to do is hit the power button to turn it back on again. Everything else from the log-in to software starting up, timed schedules for the show etc is all sorted. My lighting software allows me to switch all channels on & off manually with one click, but when it comes to the nitty gritty of HOW it does it and that kind of programming skill is beyond me ;)
 

shoes

Well-Known Forumite
write the code which will set them all to off and then write a batch file, to be actioned on startup, to run this code?
 

gdavies

Well-Known Forumite
for batch codes they are pretty simple here is how the layout would be if you know the command to send the high or low signal then replace with the line referring to it.

@ ECHO OFF

Command to send low or high signal here
Print Stafford forumites rule lol
pause

EXIT

Just paste that in a notepad and save it as run.bat for example and then once it has run you will get a message saying stafford forumites rule lol just press a key to close it.

Hope that helps
 

gdavies

Well-Known Forumite
if you want it all to run via a batch file if you let me know what com port there ae running through and i will provide the text for the batch file to turn them off and then another one to turn them back on if your software doesnt do it.
 

wmrcomputers

Stafford PC & laptop repair specialist
All I know is that the parallel port is at the usual expected port of LPT1. Also it's set in bios to operate in ECP (necessary for speed in the sequences) but other than that I'm stuck.

shoes said:
Have a look at this.

EDIT: And no, I don't have a clue lol
Thanks for trying mate. Appears to be linux though :(
 

gdavies

Well-Known Forumite
if you open up a command prompt and type in mode which one does it give for lpt1 as the com port
 

Alan B'Stard

Well-Known Forumite
Would either of these do it?

http://download.cnet.com/Lalim-Parallel-Port-Control-Basic/3000-2085_4-10442590.html

http://wareseeker.com/Windows-Widgets/parallel-port-1.0.zip/438024
 

gdavies

Well-Known Forumite
wmr what colin has posted will do it all in a tidy program however the wareseker link would be linking to copywritten software which i am sure you are aware, but using it would save me the hassle of writing the batch program
 

wmrcomputers

Stafford PC & laptop repair specialist
Colin Grigson said:
Would either of these do it?

http://download.cnet.com/Lalim-Parallel-Port-Control-Basic/3000-2085_4-10442590.html

http://wareseeker.com/Windows-Widgets/parallel-port-1.0.zip/438024
Cant even get that to run, but again thanks for trying to help :)
EDIT: - Hang on I haven't tried the second link yet, not been getting much sleep lately as little one is poorly - lol
 

basil

don't mention the blinds
Am i alone in finding the contents of this thread totally alien language.........
 

gdavies

Well-Known Forumite
ok the batch script you request is

////////////////////////////////////
@ ECHO OFF

TITLE STAFFORD FORUM HELPINGS BY GDAVIES
SET SAFETY OFF
MODE LPT1:,,P
PRINT LPT1 PORT DISABLED
PAUSE
SET SAFETY ON

EXIT
///////////////////////////////////

all the text between //////////// needs to be copied and pasted in a text pad, then click save as and have the file type as all file types, then save as lptdisable.bat

When done it will create a dos icon where you have saved it too and will also prompt you when done and ask yo to press a key to close, it will also help turn off the safety featurs for the command to pass through and then when done it will turn the safety back on to allow the normal commands and nothing else to disable it,

Let me know how you get on as have had to rack my brains as not on my pc on the good ol mac and not got dos to test it just terminal. should work though
 
Top