A
Hello,
I have a problem with the delay when I'm working with the serial port in visual basic.
When I click on the button (i.d. when I send "M") i receive the values from the port always late. can you help me?
The "M" "T" and "C" commands are pre-programmed in the device which is connected to the serial port.
regards.
my code is like below:
Private Sub Command1_Click()
MSComm1.Output = "M"
Label1 = Val(MSComm1.Input)
End Sub
Private Sub Command2_Click()
MSComm1.Output = "T"
End Sub
Private Sub Command3_Click()
MSComm1.Output = "C"
MsgBox "Erased"
End Sub
Private Sub Form_Load()
MSComm1.CommPort = 1
MSComm1.Settings = "9600,E,7,1"
On Local Error GoTo error
MSComm1.PortOpen = True
Exit Sub
error:
MsgBox ("Port can not be open" & Error)
Exit Sub
End Sub
I have a problem with the delay when I'm working with the serial port in visual basic.
When I click on the button (i.d. when I send "M") i receive the values from the port always late. can you help me?
The "M" "T" and "C" commands are pre-programmed in the device which is connected to the serial port.
regards.
my code is like below:
Private Sub Command1_Click()
MSComm1.Output = "M"
Label1 = Val(MSComm1.Input)
End Sub
Private Sub Command2_Click()
MSComm1.Output = "T"
End Sub
Private Sub Command3_Click()
MSComm1.Output = "C"
MsgBox "Erased"
End Sub
Private Sub Form_Load()
MSComm1.CommPort = 1
MSComm1.Settings = "9600,E,7,1"
On Local Error GoTo error
MSComm1.PortOpen = True
Exit Sub
error:
MsgBox ("Port can not be open" & Error)
Exit Sub
End Sub