Hi ,
I have a variable declared as uint16.
To use this variable in a control algorithm, I have to convert this in format Q17 .
This format in simulink matches fixdt (1,32,17).
HowI should do?
I'm using simulink and code coposer studio
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi ,
I have a variable declared as uint16.
To use this variable in a control algorithm, I have to convert this in format Q17 .
This format in simulink matches fixdt (1,32,17).
HowI should do?
I'm using simulink and code coposer studio
You can simply use this instruction _IQ(your value). This will convert the variable from u16 to _iq.
But you need to look that your u16 value does not get beyond the maximum value IQ17 can posses. The maximum value is (+/- 16384).
If it is in range you can simply the use the instruction.
Regards