I am using RS232 IC to interface between the controller (ATmega16) and the PC.... I communicated only threw serial port and not the USB port.... Now i cant receive any data's from the port, but the port is opened and closed successfully by both VB and Serial Port Access software (LOOKRS 232).... Should i alter my code Option Explicit Private Sub Form_Load() MSComm1.Settings = "9600,N,8,1" MSComm1.CommPort = 1 MSComm1.InputLen = 1 MSComm1.PortOpen = True MSComm1.RThreshold = 1 MSComm1.InputMode = comInputModeText End Sub Private Sub Form_Unload(Cancel As Integer) If MSComm1.PortOpen = True Then MSComm1.PortOpen = False End If End Sub Private Sub MSComm1_OnComm() Dim InBuffer As String
InBuffer = MSComm1.Input If MSComm1.CommEvent = comEvReceive Then Text1.Text = Text1.Text & InBuffer End If End Sub
|