‎01-19-2013 02:27 PM
Hello
I want to Recive an 600*1 array from Serial Port then consider each two byte as one number(Word).
How Should I do this?
‎01-19-2013 02:45 PM
It depends on how the data is sent. Is it binary or text? Is the low order byte sent first or last? How do you know when the the array starts and ends?
None of these things is standardized in any way when transmitted over a serial port. You have to know how the data is formatted, or you may have a difficult time trying to reverse engineer the data.
Lynn
‎01-19-2013 02:50 PM
To add to Lynn's reply, assuming the data is binary, you can read 1200 bytes, then use String to Byte Array to get a 1200 element U8 array, use Decimate 1D array to separate it into two 1D arrays (even and odd) and then iterate over them in a for loop and use Join Numbers to get a U16 (the last step might work without a loop, but I can't check).
‎01-19-2013 02:55 PM