Option Explicit On Imports System.Data Imports Microsoft Imports MessengerAPI 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) Public Class Form1 Inherits System.Windows.Forms.Form Dim Value As Integer Dim PortAddress As Integer Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Test program for inpout32.dll Value = 0 'Change PortAddress to match the port address to write to: '(Usual parallel-port addresses are &h378, &h278, &h3BC) PortAddress = &H378 End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'Write to a port. Out(PortAddress, Value) 'Read back and display the result. Text1.Text = Inp(PortAddress) Value = Value + 1 If Value = 255 Then Value = 0 End Sub End Class
I used this VB program as a direct input and out to my parallel port,but when I start debuggin it ,it shows to me a massage "SEHException was unhandled,so can any one tell what it meen.
I used VB.NET and used the DLL"inpout32" for direct access. I copied them from CD to Widows/system directory.
is there another way to access parallel port.
This post has been edited by mmk: 24 April 2007 - 03:20 AM