What's the proper way to convert a signal of type "single" to a vector of two "uint16" in Simulink with Embedded Coder?

3 次查看(过去 30 天)
This seems like a silly question, but it really isn't clear to me how to do this. Converting a float to an array of chars or uints is a pretty simple operation in C; and often necessary when building and parsing messages. Still, I can't find anything obvious in the documentation about this. I'm hoping that it's so obvious that it's not really explicitly mentioned, but I have my doubts. The existence of such blocks as "byte pack" and "CAN pack" suggest that there is no easy way to do this without employing such blocks. Unfortunately, "byte pack" fails to properly pack float types on the TI 28335, probably because it is only word-addressable.
Am I missing something here? I had a look at the "data type propagation" blocks, but the documentation is inscrutable... Surely there's an easy way to do this?
Thanks.

回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by