Forum Index > comm64 - input handling

By: David Posted on: Apr 21 2016 at 06:45:49 AM
Hi All,

This is my situation if I using laptop with RS232 to USB adapter to get signal from devices the signal will be (each line one input)


However when I PC with Com Port and following the data will receive from the program


Any solution or idea to make sure the "input" is receive the complete data and break one by one as above?

Following is my parameter setting on comm64

Comm1.CommPort = 1
Comm1.Settings = "2400,N,8,1"
Comm1.Handshaking = 0

Comm1.OutBufferSize = 1024
Comm1.sThreshold = 1
Comm1.InBufferSize = 4096
Comm1.rThreshold = 1
Comm1.InputLen = 0

Thank You!

By: Guest Posted on: Apr 25 2016 at 07:36:14 PM
The problem is that you, as a human, knows that the data is in distinct packets like
etc, etc.

But, in fact, it's just a continuous stream of data lik.

and theres no way that windows, or the serial port, can know where one packet ends and the other starts.

I guess there's a slight time gap between packets and the laptop, conincidentally, is grabbing the data between packets. But, as i said, that is more by coincidence than by design so you have to assume the data will come in irregular packets.

The correct way to do it to have a routine that simply reads data from the port and appends it into a local buffer. Then have another routine that is parsing the buffer looking for complete packets.

On the other hand, are the data packets seperated by anything such as a carriage return or line feed?. If they are then you could buffer the data locally until that character is received.


Reply - add comment to this topic
You may enter letters, numbers and standard punctuation only. HTML and other scripts/tags will be rejected
  Topic:- comm64 - input handling

Your Name


Forum scripts and databases - Copyright (c) 2009 - 2012