Shoutbox

[HELP] LPT1 code problems - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [HELP] LPT1 code problems (/showthread.php?tid=62714)

[HELP] LPT1 code problems by novolo on 07-07-2006 at 03:00 AM

Hi,   I'm kinda still learning to code, so be aware! my errors could be VERY BIG :P

the thing is,  i want to control the data pins on my LPT1 (parallel port)  so,  I'm using the io.dll as suggested by Themuzz  with the Command:  Call PortOut (888,1)

so, here's the code i use to activate a pin:

code:
Interop.Call("C:\TEMP\SCRIPTS\LPT!\io.dll", "Call PortOut", 888 , 1 );


i came to this after several attempts that the code was wrong and didn't allow the script to initialize..     now,  no errors appear,  but.......    the pin is still off...

I've checked it and this doesn't work...  the pin 2 doesn't turn on.. :(

so, my last chance is to ask someone here for help...

all i need is this code to work so i can get my code up and running...

i have it already working to start applications remotely,  but if i can make this work i could be able to turn on and off lights, radio, tv, heating, etc...

PS:  it also would be nice  if you could tell me whats the command to turn off one pin :P   
RE: [HELP] LPT1 code problems by cloudhunter on 07-07-2006 at 03:40 AM

Maybe in the path it should be LPT1 not LPT!?

Cloudy


RE: [HELP] LPT1 code problems by matty on 07-07-2006 at 03:45 AM

quote:
Originally posted by cloudhunter
Maybe in the path it should be LPT1 not LPT!?

Cloudy
Ummm maybe thats the path to the file?

Did you actually code the DLL? if so if you put it in an exe does it work?
RE: [HELP] LPT1 code problems by ShawnZ on 07-07-2006 at 04:06 AM

I didn't know you could have spaces in function names...


RE: [HELP] LPT1 code problems by cooldude_i06 on 07-07-2006 at 04:49 AM

quote:
Originally posted by ShawnZ
I didn't know you could have spaces in function names...

yeah, according to this site

http://www.geekhideout.com/iodll.shtml

the function is PortOut, you dont need the "Call "
RE: [HELP] LPT1 code problems by novolo on 07-07-2006 at 12:09 PM

ok, i got something from a web using io.dll but in VB,   the call the function PortOut with its proper value, like, port is integer and Data is byte

code:
Private Declare Sub PortOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Byte)


maybe i should do something like this but in jscript....

any ideas?
RE: [HELP] LPT1 code problems by CookieRevised on 07-07-2006 at 01:16 PM

As Shawnz already suggested, the function is called "PortOut" not "Call PortOut".

"Call" is the command in VB to call/start functions, just as "Interop.Call" is in msgplus!' jscript...


----------

I'd also suggest to read the documentation for this DLL first (follow link given by CoolDude). Also you need to call IsDriverInstalled to make sure the other functions and procedures can be used. etc...


RE: [HELP] LPT1 code problems by novolo on 07-07-2006 at 02:05 PM

yeah, sorry,  my mistake...    anyways..     with the code like:

code:
Interop.Call("C:\TEMP\SCRIPTS\LPT!\io.dll", "PortOut", 888 , 1 );

it doesn't work...  :S

any ideas?
RE: [HELP] LPT1 code problems by CookieRevised on 07-08-2006 at 11:08 AM

1) Make sure the driver is initialized and can be run. See previous post and read the documentation carefully.
2) Make sure your electronics work.
3) Make sure you readout the correct pin.
4) Make sure the lpt 1 port is at the address 0x378. Check your bios and Windows settings...


RE: [HELP] LPT1 code problems by novolo on 07-08-2006 at 04:54 PM

Ok,  i've checked everything except if the driver is initialized and can be run..    i don't know how...

i mean,  reading the scripting documentation is how i got this code...       i mean,  it should work with this right?


RE: [HELP] LPT1 code problems by CookieRevised on 07-08-2006 at 05:30 PM

quote:
From the IODLL documentation

IsDriverInstalled
Returns non-zero if io.dll is installed and functioning. The primary purpose of this function is to ensure that the kernel mode driver for NT/2000/XP has been installed and is accessible.
Also read the additional LPT documentation listed on that official IODLL page.

Note that it is also pin 2 you need to check for data line 1. And in that same context, I'm not even sure if sending byte value 1 will actually trigger pin 2 (data pin 1) to go high, or even long enough high to notice it. This driver is a general IO driver, not a specific one for parrallel ports. It doesn't contain timings either, you need to program that yourself. Make sure you use the proper functions and the proper values to make data pins go high.

Also, if you have a running and working example in VB6, base the code on that. In other words, make it working in VB6 first (or C or whatever language you're more comfortable with)
RE: [HELP] LPT1 code problems by Themuzz on 07-12-2006 at 07:48 AM

Hi, hehe

just wait till someone releases a program or an easier way to design conf windows (xml) and i will release mine....

Btw Novolo, you forget a few things..

But for the rest, great work (Y)

(I'm away for 2 or 3 days so after that perhaps i will program my own window in xml without an easier way...)