开发者

Locating data (like pressure etc) in a raw data stream

开发者 https://www.devze.com 2023-02-16 22:28 出处:网络
I am a newbie to Serial Port Analysis and I would appreciate some help on this. my specific question is...

I am a newbie to Serial Port Analysis and I would appreciate some help on this. my specific question is...

If I have raw data from a serial port analyzer program, how will I locate measures like temperature, pressure, energy etc? What should I look for in the raw data that will help me identify these units of measure? What is the best way the extract relevant data from this raw data?

I would be very grateful if you can provide me any help with respect to this. I am unable to figure out how to do this.

Thanks a 开发者_运维百科lot.


The best way that I know of to do this is to find the "reset" identifier, also called the "End of Stream" identifier or sequence. I am assuming that the data is a continuous flow not a one-time transmission.

If the data is continuously cycling, you need to find where the transmit begins (or ends) and then start metering your capture from there. Most devices will have an associated manual or documentation that give you the end sequence (or optionally the start sequence) and then the method by which they identifier their data.

For instance, the device may end a message by sending 4 all zero bytes in a row, then begin again by sending one byte that identifies the sensor, and another two bytes with the data, followed by the next sensor etc.

You would then watch the stream for 4 zero byte entries, and then start capturing 3 bytes at a time, one for the sensor and two for the data, until you saw 4 zero byte entries in a row again.

0

精彩评论

暂无评论...
验证码 换一张
取 消