Answer the question
In order to leave comments, you need to log in
How to correctly receive data from the com port?
The laboratory has a Belarusian device MNIPI E7-20 (Immittance meter). The instrument communicates with the PC via the RS-232C interface. And is in a state of continuous data transmission. Those. every (different in size) period of time, it sends a packet of 22 bytes to the port. Each packet starts with a sync byte - 0xAA.
In addition, due to errors, the device can "eat" part of the data packet and send it to the port.
The operation of the device looks like:
SUBZH: How to properly organize data reception? How can I make the program wait for the synchronization byte, and immediately after it read the data packet?
Answer the question
In order to leave comments, you need to log in
Correctly read data from the port into the buffer, and then asynchronously look for the beginning and end of the packets.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question