Save data from a TCP/IP stream with tmtool

1 visualizzazione (ultimi 30 giorni)
Konstantinos
Konstantinos il 22 Mag 2015
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

Risposte (0)

Categorie

Scopri di più su Oceanography and Hydrology in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by