To write to the port, simple...
Sub WriteToPort()
Dim printString as String
printString = "Sample Raw Data"
Open "LPT1:" For Output Access Write As #1
'-- Could also be Open "LPT1:" For BINARY As #1
Print #1, printString
Close #1
End Sub
To read, not so simple
you need a dll called inpout32.dll, download
it from this site...
http://www.pcgadgets.com/download.html make sure you put the dll in the system32 dir. You will need to declare it for use
Public Declare Function Inp Lib "inpout32.dll" _
Alias "Inp32" (ByVal PortAddress As Integer) As Integer
Public Declare Sub Out Lib "inpout32.dll" _
Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Integer)
Then it is these two for use:
Function DataPortRead%(BaseAddress%)
'-- Reads a parallel port's data port.
DataPortRead = Inp(BaseAddress)
End Function
Sub DataPortWrite(BaseAddress%, Value%)
'-- Writes a byte to a parallel port's data port.
Out BaseAddress, Value
End Sub
if you have problems look at the gaget code you download from the link above