No of times DataRecieved ,Serial Port ,C#

Posted by Raja_89 under C# on 2/17/2015 | Points: 10 | Views : 484 | Status : [Member] | Replies : 1
Hai

I am passing a command to Serial port to give n no dispense
How can i get n value

i tried with

Cnt=0;
check cnt is less than n
if yes
cnt+1



It shows n+1
How can i avoid this

Example

if n=2
it shows n=3


Regards




Responses

Posted by: Jitendrasoft09 on: 2/20/2015 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi,

It seems to look cnt is adding count from serial port so you have to make sure dispense must serialize properly, please refer below code snippet and fit in your requirement.

byte_count = comPort.BytesToRead;


Please refer below link for more details-
http://stackoverflow.com/questions/27110450/serial-port-datareceived-firing-multiple-times


Jitendra Kumar
If my post helps you, plz mark as an answer.

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response