MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

Go to page 1Go to page 012Go to page 2Go to page 2
Avatar
Ted_Toad
Posts: 7
Hi there I've been trying to display the elevator trim value on a four digit display. The numbers coming from FSUIPC are like .00044 or - .0012. To make these readable I have been just multiplying $*10000 and end up with a displayed value in the single digits to hundreds. That is useful but the actual trim wheel in the sim shows values like +1.2 degrees and -0.1 degrees, which would be even better.
Just curious if anyone has solved this. (btw: the plane is the Just Flight Arrow III)
2021-07-08 14:12
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi
I not know the Aircraft you use..... But if it work with the "standard Data" (FSUIPC) then it should be just a "math" work.
( I do this for PMDG already)

If we talk about FS2020 may its different. Here we would need to figure it out...... But technical it´s the same procedure in case the Trim should be "linear"

Step 1
Trim to one side as much as possible.....
Check what Value is displayd in the VIRTUAL Cockpit.... e.g. on a virtual Display or via Mouseover. Note this value on paper.

Step 2
Check what the RAW Value is showing on the Offset (or FS2020 Simconnect Output) at this moment and notice this on a paper.

Step3/4
Do the same with the other End ! Trim as much as possible to the other side and again note the Shown Value in Cockpit and the Value on the Offset/Variable you read.

Step 5 Calculate it.
You know "range" from the Virtual Indication ( You like to show on your Display) ..... And you know Real Range from the Raw Data.
Now all you need is a formula ..... In case it´s linear you pretty sure can "divide" it to have the same sequnece and you can "add or subtract" a fix Value to reach the -xx to +yy Situation.


I can offert you.... Call me tonight via DISCORD when i´m online. Then we can do this together via shared screen !
Good Luck !
2021-07-08 17:30
Avatar
Ted_Toad
Posts: 7
Thank you for the input, this is indeed how I ended up going after it after some trial and error. Now have a formula that gets very close to what is indicated in the cockpit. Had to set up a formula then add a small 'fudge factor' as we say in the US but now it's close enough.
Appreciate your support of this great product.
2021-07-10 13:13
Avatar
Ilirio
Posts: 38
Hi!


I was trying to do something similar for the new MSFS JU-52. I had no problems on controlling the Elevator Trim with a rotary, and I also got the values for max, min, step and offset to show them in an LCD. However, somehow I'm not able to display a float number. For example:

0º of elevator trim (as shown in the sim gauge) corresponds to a value of 0.0130 in Control - Elev Trim preset, +1º to 0.0260, etc. and step every time I increase or decrease trim is 0.0005

So I apply a transform like this: ($*10000/130)-1 and ask to display in LCD as "ELEV-TRIM $$$". When I run this settings value to display is always an Integer so I have no chance of showing a x.xx or -y.yy value.

Any clue of what I am doing wrong?
2021-10-15 08:57
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1867
Supporter
Hi Ilirio,

no, you are not doing wrong, on the contrary, you are on the right track. As a result, you just missed the last step.

First of all: The result of a calculation in Transform is always an integer value. If your input value is now a FLOAT and the value e.g. 0.0125 comes out, then the value 0 always appears in the output, provided you use Transform.

Since you recognized this, you multiplied the who by 10000 and got the value 125, but somehow the value 1.25 should be displayed.
You have now defined for your LCD that the output value should be displayed as $$$, therefore 125 is displayed to you.

If you now define $. $$ in the setup for the LCD, then the value of 125 will be displayed as 1.25.

The $ value as such is still displayed as 125, but in the LCD by the "." shown interrupted and therefore you will see the value 1.25 optically. You see, you didn't do anything wrong, you just didn't think through to the end.

Try it out and report how you got the result.
Grüße,
Stephan (Time: UTC+2)
2021-10-15 11:02
Avatar
Ilirio
Posts: 38
Hi Stephan!

Thank you for your help! Now it nearly works... for transformed values greater than 1 or less than -1 it works perfectly, but for values between -1 and 1 it displays .xx or .-yy instead of 0.xx and -0.yy. Is there any way to correct this?

Thanks in advance!
2021-10-15 20:45
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1867
Supporter
Hi Ilirio,

yes there is a way to correct it.

Before you start, please make a copy of your existing "hot".mcc config file. If something went wrong you will have a working config which you can always duplicate as often as you want.

The correction is possible with a precondition.
Go to your config of the offset for the trim value.
Do not change anything in the tab SIM VARIABLE.

Click on PRECONDITION

Hook the first line in the precondition list and then choose the type of Precondition and choose CONFIG ITEM.
Beside CHOOSE CONFIG you have to look for your config with the trim value.
in the line IF CURRENT VALUE IS choose >= and insert in the next field 1
Press APPLY
Now your precondition is above in the precondition list.
Now you have to change the logical operator. At the moment you see here an (AND).
Click this line with the right mouse button and go to logic operator and choose OR.
Now the operator change from (AND) to (OR).
Press again the right mouse button and choose ADD PRECONDITION.

Hook it and choose the type of precondition. Take again config item.
At CHOOSE CONFIG choose again your config with the trim value.
IF CURRENT VALUE IS you have to choose <= and in the empty field you insert -1.
Press APPLY

Now you have two lines with a precondition conected with an OR. Please ignore the (AND) at the end of line two.

What will happen? If your trim value is greater or equal than 1 OR smaller or equal than -1 this config is active. In all other cases this config is inactive.

Now you need a 2nd config for your LCD and the trim value.

So go to your trim config and click it with the right mouse button and choose DUPLICATE ROW.

Now you have two identical configs for your trim value but this one you have to change as follows:

Click on edit config (...)
Do not change anything in the tab SIM VARIABLE.
Go to the tab PRECONDITION
Click on the first line and change at IF CURRENT VALUE IS the >= into <
Press APPLY.
Right mouse button on this config and change the logic operator from (OR) into AND
Click on the 2nd line and change at IF CURRENT VALUE IS from <= into >= and change the 1 into a 0
Press apply

What will happen? this config is only active if the trim value is smaller than 1 AND greater or equal than 0. So the range from 0.99 to 0.00 is covered.

Now go to the DISPLAY tab. Here is your config what the LCD should show
Go to the position where you have $.$$ and change the 1st $ into a 0

Clich OK and rename this config i.e. into trim 1-0.

Now we need the range from -0.01 to -1.

Click right mouse button on the config TRIM 1-0 and choose DUPLICATE ROW.
Go to this new config and press edit (...)
Click on the tab PRECONDITION
Click the first line and change in IF CURRENT VALUE IS the 1 into 0
Press APPLY
Click the 2nd line and change the current value into -1.
Press APPLY
What will happen? This config is only active, if the trim value is smaller than 0 AND greater than -1.

Now go to the tab SIM VARABLE.
Make brackets arround the existing formula () and at the end type *-1 so you have then ([your formula])*-1
Why this? The trim value will change to positive because in this config it is negative and we multiply it with -1, so minus multiply with minus is positive.
I will explain this shortly.
Now go to the display tab.
Look for the position where is 0.$$ and make a - in front of the 0. There should be -0.$$.

We made the sim variable positive while multiplying with -1, so you would see here a positive value. By writing a - in front of 0.$$ we have back again a negative optical value.

Press OK and rename this config i.e. into trim -1-0. Any other description is also ok.

Now you have three configs. The first shows you the values greater 1 and smaller -1 in the correct format.
The second one shows you the values between 1 and 0 and the third one shows you the values smaller 0 and greater -1, also in the correct way.
You see, a little bit laborious, but works, right?
Grüße,
Stephan (Time: UTC+2)
2021-10-16 13:37
Avatar
Ilirio
Posts: 38
It worked!!!

Thanks Stephan for your detailed explanation. I had to had two more conditions, because at the beginning it wasn't properly for values between 0.01 and 0.09 as well as fro values between -0.01 and -0,09 but using your guide it was very easy to complete the conditions and display for those ranges.

Just one last question...

Now I have my trim correctly displayed for all the range, that is, the first line in my LCD Display shows the following ELEV-TRIM (-)x.xx. Now, I would like to display in the second line of my Display another value, is that possible? I tried to add a single text (just for testing) but I didn't see anything when I ran the configuration. I also tried to add that second line using another line in the mobiflight configuration, but then the first with the trim info blinked and even the second was neither displayed.
2021-10-19 06:31
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1867
Supporter
Hi Ilirio,

sure, also that is possible.

Your problem in the moment is, that you have three configs for your trim where only one is active at the same time.
If you now create a config that works with the same LCD you got a conflict. On the one hand you show the trim and at the same time you want to show i.e. COM1 on this LCD and on the other hand you want to show your new value. So you have a conflict with the LCD because you try to show your trim and the new value at the same time on the same LCD. That is the reason why the LCD is blinking.

But it is possible.
Separate yourself from the thought of wanting to access the LCD with multiple configs. Just use the configs for the trim.
MobiFlight can work with the config references. These are the lines in the SIM VARABLE tab at the bottom.

The procedure is as follows:

Create a config for COM1 as normal and give it a name. Find the offset and enter all the necessary data in the SIM VARIABLE tab. Complete this entry with OK.

Now you go to the 1st config for the trim. Again in the SIM VARIABLE tab.
Now you look in the lower section and see the CONFIG REFERENCES there.
Check the 1st reference, open the list next to it and look for your config for COM1. You leave the "#" to the right of it like that.

Now switch to the DISPLAY tab. Here is your screen output for the LCD. Go to the 2nd line and enter:
COM 1: 1##. ## or, depending on the offset used, ###. ### (if your aircraft shows 3 digits after the decimal place).
Of course you can also display other offsets, but try to use an offset that does not depend on a precondition.

By entering the # sign, the offset value is shown on the display, but only as long as this config is valid and active in terms of the trim value. In other words: you must also make this change in the other two configs for the trim, otherwise COM1 will no longer be displayed if a trim config other than the first one becomes active.

Now you can also display a 3rd or 4th value on the LCD, but always remember to enter the extension in all 3 trim configs.

What else you should keep in mind: I recommended that you use the # sign to represent values. These characters (#, §,?, /,) Are useful because they do not appear in normal text.
You can also use letters, but if you use the C, for example, this has the disadvantage that the value is already output at COM 1: in that the C of COM 1 is displayed as the first value.
You see, you have to be careful here !.
Grüße,
Stephan (Time: UTC+2)
2021-10-19 09:16
Avatar
Ilirio
Posts: 38
Hi Stephan!!

Me again :( :( . I did as you said and I was able to display my information in the first line of the LCD. No matter what I wrote in the second line it wasn't displayed. Even though I tried to write just characters in the whole lcd but only the first line was written.

Then I disabled all my trim entries and created a new dummy one just to test the display and I was correctly displayed.

Moreover I tried to fill the Display with the following (for the active condition):

ELEV-TRIM 0.0$
FLAPS-IDX #
********************

And what I got in the display was

ELEV-TRIM 0.00
********************

Why is skipping the second line?! (If I remove the # variable, the result is the same)
2021-10-20 17:26
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1867
Supporter
Did you use a MEGA as module?
Grüße,
Stephan (Time: UTC+2)
2021-10-20 23:01
Avatar
Ilirio
Posts: 38
iconStephanHo:

Did you use a MEGA as module?



Hi Stephan!

Yes, it is a MEGA, not a genuine Arduino one, but a MEGA after all. In fact I used it in the past for showing some AP values I now have mapped into another module, but although the Test works ok, I cannot write on the second line. Ok, I've worked around it by inserting my info in the third line and it works, but it still it would be nice knowing what's happening.

Also I observed in the online log at the bottom of the window that the second line in the display didn't appeared at all, that is, if I had the text

ELEV-TRIM 0.0$
********************
FLAPS-IDX #

in my Display Tab, when I ran it what I could see was something like: <ELEV-TRIM 0.25FLAPS-IDX 2>
2021-10-21 07:13
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

About the missing Line..... Check your Display Settings.... May you use wrong Data here..... E.g. you use a 4 Line Display but assign it as a 2 liner.
Sometimes the Displays also use Wrong Controllers..... For example there exist 1x20 Displays..... But they are 2x10 technical.....
Means you need to write the Data "different" as it would be shown.


About the System Above....
With the "Minus" this can be tricky...... But always remember to the "RightPadding Logic" in LCD Displays.

If you show a value that have more numbers as you use as Placeholder symbols, then LCD Displays Padding RIGHT!......

For example you show a Number of 12345 on a LCD with the Code "Test: %%%" Then it will show "Test: 345" ( The 12 is cut in case only 3 Chars are used)
NOTE: This is inverted to 7Seg....: There we have a LEFT Padding.... So "12345" on a 3 Diggit Display is shown as "123" ..... Here "45" is cut !

Why i tell you that fact..... Cause we can use the trick to "Add" a High Number here.

IF Value is 123 it show "123" ..... If Value is just 12 the it will show _12 ( A Empty diggit) ..... But if we would say "$+1000" then 123 change into 1123 ....
The Screen only show 123 here ( The 4th Number is Cut) ..... IF Value is 12 then $+1000 result in "1012" ..... And it will now show "012" instead of "_12"

Only Problem in YOUR Case..... The Minus ! ..... Here we would need a different logic at all.
BUT i will say working with multiple Preconditions is not needed here!
Good Luck !
2021-10-21 19:57
Avatar
volavue
From: SEILLONS SOURCE D'ARGENS, France
Posts: 13
Hi Pizzman,
I am trying to display the elevator trim value on LCD display 8 digits (max7219).
I know that result of a calculation in "transform" is always an integer value. So from -14° to 12 ° ( variation of wheel trim) , the variation of "Flight Sim Value" goes to -0,7211 to + 0,6120. This variation is stricly linear
Then I apply in "Transform"=($*20000) to obtain in "output value" a number with 4 digits
for example: flight sim value= -0,3286 output value = -6573, or flight sim value= -0,0946 output value = -1894,
To configur the display in " ConfigWizard", I have to consider the sign minus . so I configur "use display" =1,2,3,4,5 and "set decimal point" in 3
FIRST question: this is correct for négatif number and for -14° to -10° ( with 2 digits before the decimal point) but for -9° to - 0°, the LCD display shows -40,62 for 4,06°(position of trim wheel).
How i can sove this problem?
SECOND question : when the wheel trim is in position "nose up" ( positif number) , the sign disappear and the position set decimal point is wrong ( for example :flight sim value= 0,1894 output value is 3788 and LCD display indicates 037,88 instead of 3,7(°) or flight sim value= 0,5663 output value = 11326 and LCD display indicates 113,26 instead of 11,32(°)
How i can go to positif number (without sign) to négatif number without to modify the position of decimal point?

If have to write a "precondition". please help me to do that ( I use offset "sim connect elevator trim indicator" and "A: elevatortrim indicator position" ( for MS2020 with C172)
JJZ
2021-11-27 10:34
Avatar
volavue
From: SEILLONS SOURCE D'ARGENS, France
Posts: 13
Hi Pizzman,
I am trying to display the elevator trim value on LCD display 8 digits (max7219).
I know that result of a calculation in "transform" is always an integer value. So from -14° to 12 ° ( variation of wheel trim) , the variation of "Flight Sim Value" goes to -0,7211 to + 0,6120. This variation is stricly linear
Then I apply in "Transform"=($*20000) to obtain in "output value" a number with 4 digits
for example: flight sim value= -0,3286 output value = -6573, or flight sim value= -0,0946 output value = -1894,
To configur the display in " ConfigWizard", I have to consider the sign minus . so I configur "use display" =1,2,3,4,5 and "set decimal point" in 3
FIRST question: this is correct for négatif number and for -14° to -10° ( with 2 digits before the decimal point) but for -9° to - 0°, the LCD display shows -40,62 for 4,06°(position of trim wheel).
How i can sove this problem?
SECOND question : when the wheel trim is in position "nose up" ( positif number) , the sign disappear and the position set decimal point is wrong ( for example :flight sim value= 0,1894 output value is 3788 and LCD display indicates 037,88 instead of 3,7(°) or flight sim value= 0,5663 output value = 11326 and LCD display indicates 113,26 instead of 11,32(°)
How i can go to positif number (without sign) to négatif number without to modify the position of decimal point?

If have to write a "precondition". please help me to do that ( I use offset "sim connect elevator trim indicator" and "A: elevatortrim indicator position" ( for MS2020 with C172)
JJZ
2021-11-27 10:47
Go to page 1Go to page 012Go to page 2Go to page 2