I am using Serial Port interrupt routine. I set the ReceivedBytesThreshold at 1K (1024 Bytes), so in the manners interrupt should be occur at 1K data. But whenever character "&" (0x26) receive an interrupt generates, it is braking the rule of ReceivedBytesThreshold and there is no method found to change this character. How i can change it or any way to solve this problem?
viernes, 02 de diciembre de 2011 9:37
- Cambiado Esther FanMicrosoft employee lunes, 23 de abril de 2012 1:05 (From:Visual Studio Class Designer)
Todas las respuestas
Welcome to the MSDN Forum.
Please take a look at this thread: http://social.msdn.microsoft.com/forums/en-us/vcgeneral/thread/1786654E-7314-4F0E-9397-BD82862B91CD
You need to check where you have set the serial port interruption to "&".
MSDN Community Support | Feedback to us
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
miércoles, 07 de diciembre de 2011 8:35
Is it .Net Framework 4 class SerialPort class?
If it is, you may review http://blogs.msdn.com/b/bclteam/archive/2006/10/10/top-5-serialport-tips-_5b00_kim-hamilton_5d00_.aspx at first. It provides details about DataReceived event:
“In general, if you set the ReceivedBytesThreshold to some value, say n, the interpretation is the same: you will get a DataReceived event when at least n bytes are available; not one per every n bytes.”
The DataReceived event is not guaranteed to be raised for every byte received(default). Use the BytesToRead property to determine how much data is left to be read in the buffer.
Have you changed the SerialPort.Encoding?
Can you repro this issue with a few lines code?
Jungang Baimartes, 20 de diciembre de 2011 15:34