How to prevent implicit promotion from single to double when using CAN Pack block?

4 visualizzazioni (ultimi 30 giorni)
I am using the CAN pack block for my embedded system, and am trying to figure out how to prevent an implicit conversion from a single to a double in the code generation. When trying to evaluate the conditional statement (outValue > 2147483647.0), the packed variable gets implicitely promoted to a double.
I had a similar issue with the CAN unpack block assuming all variables would be doubles, and I was able to overcome this by using the signal specificaion block as shown here: https://www.mathworks.com/help/vnt/ug/control-can-unpack-block-output-type.html However, using the signal specifications for CAN packing does not achieve similar results

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by