From: <ko...@at...> - 2002-02-13 22:04:44
|
So I probably know less perl than you (I try pretty hard not to learn it).... I'm pretty sure Borland has made freely available a C compiler that may be useful for you. This site may be useful in parallel port programming. Finally, I'm assuming you're not going to drive the relay directly from the parallel, right? Kevin > Alrighty, > A week ago I asked it there was any way to read and write to the > parallel > port like the serial port. The response was that it could not be done like > a serial port. So, I, have to find other ways. What I have here is a > little bit of code I found on the internet and a DLL also. The code goes > like this: > use Win32::API; #load API module to interface DLL's > > $GetPortVal= new Win32::API("inpout32", "Inp32", [I], I); #import Inp32 from > DLL > $SetPortVal= new Win32::API("inpout32", "Out32", [I,I], I); #import Out32 > from DLL > $input= $GetPortVal->Call(0x378) & 255; #get and display current value of > address > 378 hex print "$input\n"; > $return=$SetPortVal->Call(0x378,35); #set pins 2,3,7 > $input= $GetPortVal->Call(0x378) & 255; #get and display updated value of > address 378 hex > print "$input\n"; > > So, since I know hardley anything about what I am doing, I need some help. > > If I use this code exactly, mh, returns; > Cannot use bareword "I" while strict subs. > > If I put ' ' these around both I's it returns the value of 255. But the > number 255 is not the actual number that is there. I know this by running a > QBasic program that looks like this; > > n=inp($H378) > Print n > > it would return the value of the parallel port that I actully set it to. I > am not sure if the ' ' actually chage somethime major withe the code. More > Information is available at http://www.lvr.com/jansfaq.htm > > The whole reason I want to know this is that I am trying to control 12V > relays with the parallel port. I could make a simple QBasic program that > would read the address and return it to perl, but, I have no way to compile > it. I have searched the net for information with parallel ports and perl, > but, there is none available. ( atleast I could not find it) > > If anyone has the spare time to give me help, please let me know. > > Thank You > > Larry Roudebush > > > ________________________________________________________ > To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365 > |