Thursday, September 24, 2009

Paralel Port With Net 2005

On previous posting i have write a project for visual basic 6.0 for parallel port using driver link. Now on the VB 2005 I try accessing parallel port using Inpout32.ddl from www.logix4u.net. This ddl is free so far the application not for commercial use. You can download inpout32.dll direct from logix4u, but on the test project I attach too for your download.

Before started, we must put or copy the inpout32.ddl into windows system 32. After that we add a module, and add the code below into module.

Option Explicit On

Module inpout

Public Declare Function Inp Lib "inpout32.dll" Alias "Inp32" (ByVal PortAddress As Short) As Short
Public Declare Sub Out Lib "inpout32.dll" Alias "Out32" (ByVal PortAddress As Short, ByVal Value As Short)

End Module

Add the form with radio button and button like below :
Ussualy on the PC only have one paralel port and the hexa address for this port is H378, but some PC have 2 paralal port , so the radio button give chance for PC with 2 paralel port to choice which Paralel will be used.

Another is 8 button to represent the data port on paralel port. So if press S0, the Data D0 should be ON and more for another Button. the meaning of value at LPT is status value on paralel port and for input value is the data value to sending paralel port.

For testing program you can create simple electronic circuit with LED (light emmiting diode) which connected into every data pin on paralel. The drawing of circuit like picture below. the resistor value at circuit is 470 OHM.

For source Code you can download in  here.


0 komentar: