1. 下載 inpout32.dll

2. 宣告下面函數於模組內
 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)

3. PortOutAddress = &H378
PortInAddress = &H379

4. Out使用 :
 Out PortOutAddress, OutByte

5. In 使用 :
 InByte = inp(PortInAddress)
 InByte = InByte Xor &H80

Link:
 VB I/O
 VB Printer I/O 使用說明
 Power tools for interfacing : Parallel Port



Sophialiu 發表在 痞客邦 留言(2) 人氣()