Parallel Port Interfacing
Parallel Port Interfacing
INTERFACING
GROUP 8
SANDICO, ARWIN
VALENZUELA, GEORGEN
VICTORIANO, RICHARD
VIZCARRA, JAMES DARWIN
PARALLEL PORT
Refers to processes that occur simultaneously.
o DATA
o STATUS
o CONTROL
1) DATA is the part that send
data, 8 bit to Printer (also
computer) that we will control signal
in each bit in order to connect with
printer for reference position of
Data Port that will equal to base
printer port position.
LPT1 Data=H378
LPT2 Data=H278
STATUS
2) is the part that verifies
the status of printer such as the
printer is error, out of paper, sending
signal to work, etc. We can use Status
Port to control equipment as Input (+5
Vdc) for reference of Data Port Data
Port will equal to the position of base
printer port+1.
LPT1 Status=H379 (H378+1)
LPT2 Status=H279 (H278+1)
3) CONTROL is the part that control
working of printer such as Strobe,
Auto linefeed, Select printer, etc. It
can receive and sent data, 6 bit for
reference position of Data Port will
be equal to the position of base
printer port+1
LPT1 Status=H37A(H378+2)
LPT2 Status=H27A(H278+2)
COMPUTER INTERFACING?
the art of connecting computers and
peripherals
THE PROBLEM:
Writing programs to talk with parallel port
was pretty easy in old DOS days and in
Win95/98 too. We can use Inporb and
outportb or _inp() or _Outp functions in our
program without
any problem if we are running the program
on Dos or WIN95/98.
Ø
Prog r amming by
Alias "Out32" (ByVal PortAddress As Integer,
ByVal Value As Integer)
"DllPort.dll" Alias "Inp32" (ByVal PortAddress
As Integer) As Integer
Dim PortData ' variable for data at port
Const AddressLPT1 =&H378 'Constant for
position of Printer Port 1(LPT1) and Data Port
Controlport2 =AddressLPT2+2 ' Constant
for position of Control Port (LPT2))
For sending value via Parallel Port, you can do
like this;
Inp ( PortAddress )
Sending output signal
So now, we will write code in control, starting to send
value to control Parallel Port. You must put in Textbox
and send value out by clicking at Command Button,
for getting value at port will show label.
ØP ro g ra m m in g to g e t in p
T h e re w ill b e th e e x a m p le o f co n n e c tin g sig n a l like
b e lo w
End Sub
The example of program
run: