please help me
i want to control pc parallel port using vb.net/vb6 , i need timer coding .
santosh

'Declare Rs232 class variables
Private m_CommPort  As New Rs232 
 
'Set default values for the public properties
m_CommPort. Open(m_ModemPort, 115200, 8, Rs232.DataParity.Parity_None, Rs232.DataStopBit.StopBit_1, 4096)

' Write an AT Command to the Port
m_CommPort.Write(Encoding.ASCII.GetBytes("AT" & Chr(13)))

' Sleep long enough for the modem to respond and timer to fire
System.Threading.Thread.Sleep(200)

'  Free CPU usage with DoEvents()
Application.DoEvents()

' Close Comm Port
m_CommPort.Close()
Private Sub tmrReadCommPort_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrReadCommPort.Tick
   Try    ' As long as there is information, read one byte at a time and output it.
     While (m_CommPort. Read(1) <> -1)
     ' Write the output to the screen.
       WriteMessage(Chr(m_CommPort.InputStream(0)), False)
     End While
      Catch exc As Exception
      ' An exception is raised when there is no information to read.
      ' Don't do anything here, just let the exception go.
   End Try
End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.