Technology Networking & Internet

How to Receive the Output Signal in VB6 Using a Parallel Port

    • 1). Download the DLL. Unzip the file and copy it to Windows’ system directory.

    • 2). Click “Start,” “All Programs” and “Visual Basic 6” to enter the integrated development interface. Click “File” and “New” to create a new project. Specify a name for the project. Select a location for the project files by clicking “Browse.”

    • 3). Click “Form1.vb” on the Solution Explorer. Click “Toolbox” and select “Text Field” to create a new text field. The system will name the text field “Text1” automatically.

    • 4). Double-click the form and enter the code interface. Declare the following to be able to use the DLL:
      Declare Sub vbOut Lib "WIN95IO.DLL" (ByVal nPort As Integer, ByVal nData As Integer)
      Declare Sub vbOutw Lib "WIN95IO.DLL" (ByVal nPort As Integer, ByVal nData As Integer)
      Declare Function vbInp Lib "WIN95IO.DLL" (ByVal nPort As Integer) As Integer
      Declare Function vbInpw Lib "WIN95IO.DLL" (ByVal nPort As Integer) As Integer

    • 5). Receive signal from the parallel port through the vbInp method. Input the code between Sub and End Sub:
      Dim strin As String
      strin = "&H" & Text1.Text
      vbInp &H378, strin
      H378 is the port address for data lines.

Leave a reply