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.

icon
Avatar
spol
Posts: 1
Hello, i learning this software so far and i have a question.
I read a lot, but coudnt find any solution. Please help.

At the end of this topic https://www.mobiflight.com/forum/topic/721.html
says "MF now be able to compare 2 ( or more) configs together within one calculation...."
My question is "How to compare 2 diffirent output values"?
Example:
Output
value1 - I get the trimwheel position from sim.
value2 - I get my potentiometr value (get it via variable from input).
I need somehow to comapre 2 this values and set 1 or 0 to my DC motor Pin.
Is it posible?

Thank you for your answers.
[Last edited by spol, 2022-01-19 19:17]
2022-01-19 19:04
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi
Welcome to Mobiflight!
The requested tool is the "Placeholder/Config Refferences" Tool
Thats the Area below the "Transform" Line in Output Configs ( And in the Tab "Config Refferences" in Input Configs)

Basic Rule.... A Placehodler/Refference is ALWAYS a existing OUTPUT Config and show the "final Output Value" of that Config.

So if you like to handle e.g. the "trimwheel position of sim" within a other Config..... then you must at first build a own Output Config that read this trim wheel position itself.
Cause then we can use THAT Config as a "placeholder" within the other.
"final output value" means.... The Refference is not the raw value of FSUIPC/Simvar.... Its always the "result" of the used other config.

Simple example.... Config 1 read Speed .... Lets say Raw speed from Sim is "100" .... If we would say in Transform "$+22" then this config give a output value of 122 ( 100+22)
If we use that config as refference in a other Config..... For sure we would now use 122 .... Cause thats the "final" Value of that config!

****

How to use: (Example)
Lets say you read Value of Speed in a Output Config ... We call it "Speed" Result is a Number e.g. 100 represent 100kt spd.
Now we make another Config and we read the current Altutude .... Again a easy number that show the current feets. LEts call it "Alt"

And now we create a placeholder (within that ALT Config).... Klick on " add refference" (right of the Transform field) .
Then enable the "use" checkmark.... And choose from the Dropdown (show all existing Output Configs) the one you like to use..... In Our example the "Speed" Config.
Finally choose for a symbol..... In Our example we choose for "a"
NOW we can use the value of the speed config WITHIN the Alt Config, by using the "a" symbol within a Formula.

Lets say we use Transform and say there.... "$+a"
$ Dollar represent the "own" value.... So the Altitude! .... "a" represent the current value of the Config "speed".
Lets say Altitude is currently 1000ft And Speed is 130kt ..... So our formula simply say $+a means 1000+130 So Result is "1130"

More advanced example.... We say... if(a>100,$,12345)
Now we say.... IF Speed (a) is greater then 100, THEN show Altitude Value ($) , ELSE ( So speed is at or below 100) show instead 12345.

*********************

About your special case....
You will Read Trim wheel by Config 1
You will read Poti Value by Config 2
You define in Config 2 a Placeholder to Config 1
Now you could say e.g. $-a ( So you sub the Virtual Trim Wheel" from the "Poti" )
If Result is "0" then poth have same position.... If Value is not 0 means there is a difference and the Motor must Turn
You also know.... If Result is negative then the virtual Trim is greater then the Poti Position. If Value is positive, then Virtual Trim is lower then Poti Pos.

So with this raw information you can build finally configs that say if your DC must turn or not.... And in what direction it have to turn !


EDIT..... Check this Vid..... https://www.youtube.com/watch?v=DZuVu4qU9Uc
(And other MF Tutorial Videos..... A lot of Stuff is explaned there !
[Last edited by pizman82, 2022-01-20 13:22]
Good Luck !
2022-01-20 13:10
icon