From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-21-2014 12:01 PM
Hi folks,
I am reading a binary string from a campbell sonic anemometer. It is transmitted via RS 232 9600 baud. The problem is as follows:
I am reading the input buffer once in a while(every 300 ms). The outpit of the sonic is much faster(every 30ms). Then there are a certain amount of bytes stored which I read. To get a proper value I have to find 2 termination bytes HEX AA and HEX 55. A complete sentence consists of 12 bytes 10 bytes each U8 values and 2 bytes termination. How do I search for them?
My idea was to see how much bytes I read, convert each to a binary array and then show them as boolean array all together(see attached VI). this works but I can't find the right binary expression for Hex AA and 55. And it is also interersting that the first collumn(bit 0) and the last one (bit 7) always stay "false". Am I doing something wrong?
Solved! Go to Solution.
04-21-2014 12:50 PM
So it would have been more useful if you would have posted example data that was read. Since I didn't have any I made some up. The attached VI will search for locations where the hex byte AA then 55 are found. It then breaks up the sections of data using this information. I wrote it two ways because as I was typing this I thought of a better way that uses string functions to break up the data into an array of data.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-22-2014 05:22 AM
Thanks,
I added my data to your little program, attached. It seems to work. Attached is also a pic with sample data viewed in a terminal program. I will try it now with my serial routine.
Alex
04-22-2014 09:28 AM
Attached is my solution.
Thanks a lot.
any suggestions and improvements are very welcome.
ALex