Hi..
Please contact us for a more detailed answer.
Re: MagniV MCAT data Type Question - NXP Community
I don't understand the answer in the link above.
Please explain in an easy way.
Solved! Go to Solution.
No,
I was giving just an example using a signed integer short variable. In your/MCAT case, the input X value is of a Q-fract type which is a value betwen -1 and 1. This will generate real-world value between -Nmax to Nmax. I think there are two facts that might be confusing:
Regards,
Michal
Dear @SW_Park ,
if I understand correctly your question posted to the other thread, you need more information about how the "Linear Transformation" of variable value works in FreeMASTER.
It is actually quite simple. The goal of the transformation is to re-calculate a value obtained from target MCU application to physical real-world units.
For example, if there is an integer variable in the MCU application which goes from 0 to 32767 while it represents a rotation speed in range of 0..3000 rpms. In this case it very convenient to use the "Linear two points" transformation which convert an X-axis value to Y-axis value according to a simple linear graph. There are two known points [0,0] and [32767,3000] in the graph as displayed below:
So, with this settings, the FreeMASTER will use a value read from MCU and puts it to X axis of the graph and re-calculates it to corresponding Y-axis value.
The other way of recalculation is using a standard linear equation Y=a*X+b, where the variable value is used as X and the result of transformation is Y. This way is more convenient when you know your 'a' and 'b' coefficients of the formula.
Of course, the MCU variable value does not need to be just an integer. There are several variable types supported: signed and unsigned integers, IEEE floating point values and also fractional Q/UQ values which are nicely described e.g. here. The FreeMASTER transformation works in all cases, so for Q values, the X range is typically from -1 to 1 while the Y range represents the real-world units.
What is also nice about FreeMASTER is that this transformation also works in the 'inverse' direction. When you want to modify the value in Variable Watch, you actually enter the 'Y' real-world value and FreeMASTER re-calculates in back to 'X' when writing it to the MCU application.
Let me know if this clarifies the issue for you.
Best regards,
Michal
Hi.
I understand the methodology.
But as you said, I think it's like the following.
x1, y1 = [ 0, 0 ]
x2, y2 = [ 32767, Nmax ]
However, the actual set values are as follows.
x1, y1 = [ 0, 0 ]
x2, y2 = [ 1000, Nmax x 1000 ]
I don't understand this part.
No,
I was giving just an example using a signed integer short variable. In your/MCAT case, the input X value is of a Q-fract type which is a value betwen -1 and 1. This will generate real-world value between -Nmax to Nmax. I think there are two facts that might be confusing:
Regards,
Michal