TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: WAYNE FOWLER
from: ERIC SCHONNING
date: 1996-06-07 00:00:00
subject: Re: Parellel Port

WF>     Oh yeah.  Yeah.  I am using a cable from one computer to the other
WF> trying to use it just like a serial cable, to send and receive data fr
WF> computer to the other.  I know there are other programs such as LapLin
WF> so
WF> on, to do this, but i want to do other things within my program aswell
 
Sorry for delayed response, have been a bit busy....  You will need to
make a special cable (or buy one) to send data between 2 computers via
parallel port.  I checked the ms-dos 6.2 help for InterLink (the ms-dos
"lan") and a cable with those pin connections would work fine. 
Assuming you have that cable already, the code will have to send bytes
4 bits at a time, and then be re-assembled by the reciever.  The extra
input/output is no doubt used as a handshaking line.  I will "wing"
some code here, but cannot guarantee it will work.  The cable has data
output bits D0-D4 going to status input bits S3-S7, respectively. 
Assuming the D4 -> S7 bit will be used for the handshaking, the sending
computer would do something like:
 
'data register is at ba, status register at ba+1
ba=&h378   'lpt base address
out ba,0  'set handshaking low initially
line input "char to send > ",c$
c=asc(c$)
lb=c mod &h10
hb=c \ &h10  'upper 4 bits
bit set hb,4  'set handshaking high
out ba,hb
out ba,0   'set handshaking low
bit set lb,4
out ba,lb  'send lower 4 bits
out ba,0
 
 
on recieving end,
 
do
  hb=inp(ba+1)
loop until bit(hb,7)
bit reset hb,7  'remove handshaking bit
do
  lb=inp(ba+1)
loop until bit(lb,7)
bit reset lb,7  
shift right hb,3
shift right lb,3
c=hb*&h10+lb
print chr$(c)
 
hope it makes sense, as stated it is untested code but maybe you can
get the idea of what I am saying.  Depending on your application, it
may just be easier to use the serial port for data transfers between
computers.  At least you can use the internal PB serial routines which
work quite nicely....          Eric
--- QM v1.00
---------------
* Origin: Creekside Manor (805) 484-8016 CdCom Support BBS (1:206/2512.0)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.