serialport datareceived event
-
hi, in my appli i need to read data thuogh serialport in two different times. 1) when i write data to handheld system through serialport ,that sholud send a success signal 2)To read some other data from serialport. for the first one, i wrote the code for receiving success data, in esrialportdatareceived event. then for 2) where can i write the code of reading. if i write in that event everytime success data is showing as output.
-
hi, in my appli i need to read data thuogh serialport in two different times. 1) when i write data to handheld system through serialport ,that sholud send a success signal 2)To read some other data from serialport. for the first one, i wrote the code for receiving success data, in esrialportdatareceived event. then for 2) where can i write the code of reading. if i write in that event everytime success data is showing as output.
You need some method to discriminate between the two pieces of data. If the device is sending the exact same string of data every time, you can check for that and have a reasonably good idea where it came from. If not, well, then you're going to have to come up with some kind of protocol, like "framing" data, that your external devices are going to need to use to identify themselves as the source. Or, put each device on it's own serial port.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak