-
Serial Communication
Hi to all:
I have a project that receive data from an electronic board and in the same project this data received must send to annother apllicattion.
For that i had use this code for receive the data:
Code:
Private Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
ReceivedText(SerialPort1.ReadExisting())
End Sub
And for send data:
Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
end sub
Like we know both this events have a constant cycle....
My doubt here is:
This is the best way to do this once this have 2 cycles? I mean this could run reasonably with a few lines of code in both events with no problem?
If possible please send me your opinions!
Thanks
-
Re: Serial Communication
It's all a bit vague. Why can't you use the DataReceived event to trigger the send also?
-
Re: Serial Communication
Ok...it's one ideia...i never thought about it!
Thanks