Hello. I am a novice user of Microsoft Visual Basic 6.0 and I am trying to teach myself how to interface VB 6 with the serial port using RS232. From what I have gathered so far I found that I need to use the control component MSComm to access the serial port using VB. So far I haven't had any luck. All I am trying to do is send some data out of the port and detect the presence of the data on the cable using an oscilloscope. Is there any reason I should not be able to detect this data as such? Is the data perhaps being stored in the transmitt buffer and not being allowed to enter the serial line of the cable. The code I am executing to try and accomplish this is as follows:
Private Sub MSComm1_OnComm()
Dim SampleText As String
SampleText = "ABC"
MSComm1.CommPort = 1
MSComm1.PortOpen = True
MSComm1.Settings = "9600,N,8,1"
Do While True
MSComm1.Output = SampleText
Loop
End Sub
Inside my hardware manager in Windows XP I have the same settings as in the Settings command in the code I have provided above. I'm pretty stuck. Please help. If there is anything that I need to clarify please let me know. Thanks a lot in advance.
Private Sub MSComm1_OnComm()
Dim SampleText As String
SampleText = "ABC"
MSComm1.CommPort = 1
MSComm1.PortOpen = True
MSComm1.Settings = "9600,N,8,1"
Do While True
MSComm1.Output = SampleText
Loop
End Sub
Inside my hardware manager in Windows XP I have the same settings as in the Settings command in the code I have provided above. I'm pretty stuck. Please help. If there is anything that I need to clarify please let me know. Thanks a lot in advance.