Save data from a TCP/IP stream with tmtool
2 次查看(过去 30 天)
显示 更早的评论
Hi,
I have established a TCP connection between a RTDS and tmtool of Matlab. The RTDS is sending 3 values to the tmtool. These values are floating point numbers, single precion (32bit) and are represented using IEEE754 format. In each time-step the RTDS sends a packet of data which consists of 12 bytes (4 bytes per value). The tmtool is saving the data in a one-column matrix in a specific order, which is the bytes of value one, then bytes of value two and then the bytes of value three for the first time-step, then the bytes of value one, then bytes of value two and then the bytes of value three for the second time-step and so on. So I would like to ask two questions:
1) In order to receive the values I have to select in the "Receiving data" tab of tmtool: "Data type" --> Binary "Data format"--> unsigned character (uchar) I was expecting in order to receive data in the same format that I am sending with the RTDS that I should select: "Data type" --> Binary "Data format"--> float
2)When I select to read the data that RTDS has sent, the data are saved into a single-column matrix value after value, byte after byte for each time step. Is there a way that I can save the bytes of each value at a different column for all the time steps? (In the case of three values, I would like to have a n-row 3-column matrix, where on the first column there would be all the bytes of value 1 for every time-step, then on column 2 all the bytes of value 2 for every time-step and so on.
Thank you in advance for your help,
Regards, Konstantinos
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Oceanography and Hydrology 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!