-
-
Notifications
You must be signed in to change notification settings - Fork 107
expression engine
With the expression engine syntax you are able to perform more complex calculations in an easy way. Additionally to the original "multiply"-field on the FSUIPC-tab in the Config Wizards you have more freedom for setting and calculating values.
If you have a look at the FSUIPC documentation, there are a bunch of offset values that need to be transformed prior to displaying them, for example on a 7 segment LED Display. One example for such a value is the "Current Heading". If the value is smaller than 0, you have to add 360 degrees. This cannot be achieved with the "multiply". Formulas that make use of the Expression Engine syntax can be put into the "If-Set-It-To-Else-Set-It-To"-fields on the "Comparison"-Tab.
The current value after the multiply operation can be referenced by using the "$"-symbol. It can appear various times in a formula if needed.
When you read out the Offset value for the, e.g. COM1 you will see that it does not contain the leading "1". So instead of 126.50 you will get 2650 only. Let's simply add 10000 in any case so that we don't have to care about this when displaying the value on a MAX7219 LED Display. The comparison tab would then look like this:
To the original value in all cases 10000 is added converting 2650 into 12650. For the Display you then add the decimal point and everything works like one expects it.
The expression engine syntax supports more complex stuff. You can use parenthesis as you know it from your math classes ;)and also there are mathematical functions available (Sin, Cos) and logical functions like known from Excel. The logical functions are used for input in the example configuration, e.g. for the COM1
In the "value"-field the following "if"-expressionif($>1900,$-100,$+1800)
is used. We want to reduce the MHz-part of COM1 reading every time the "On Left" event is triggered. The solution is more or less straight forward and easy to read if you are familiar with Excel. As long as the current value is greater than 1900 (119.00) we can reduce it by 100 ($-100). If the value of the COM1 reading already is smaller than 1900, e.g. (1850) 118.50, we want to make sure that it "wraps around" going up to 3650 (136.50). Therefore 1800 is added.
A complete documentation can be found on the Website of the expression engine library.
Hint:**Currently no real validation of your formula is performed. If the formula has a problem then an error message will be shown when the configuration is executed.
- MobiFlight Connector Installation
- Mobiflight Connector BETA version installation
- Modules
- MobiFlight Connector Files Structure
- MobiFlight Connector Uninstall
- Modules Reset to factory default
- Verifying the WASM module installation and locating the MSFS2020 community folder
- Verifying the WASM module installation and locating the MSFS2024 community folder
- Using a Winwing FCU with MobiFlight
- Using VKB controllers with MobiFlight
- Providing logs from MobiFlight
- MobiFlight Connector How does it work
- Mobiflight Connector Main Window
- Flash module with MobiFlight firmware
- Input and Output devices
- Joysticks
- Midi Boards
- Sim Variables (for Output)
- Input Actions
- Merging configuration files
- Disabling specific COM ports
- Examples Output LEDs
- Examples Input Switch
- Example 7 segment display
- Example Servo motor
- Controlling LEDs with an output shift register
- Adding lots of buttons with an input shift register
- Beginner's guide to input multiplexers
- Key Matrix with standard MobiFlight and Multiplexers
- Tutorial Easy Driver and x.27 or x.40 Stepper Motor
- Tutorial for Airbus VS display via 7-Segment LED Module
- Example Analog Input Potentiometer
- Baron G58 Tutorial Gear, Flaps, Mags, ELT Input Output Programming
- Using Mobiflight to control arduino-based 3rd party panels (RealSimGear GNS530)
- How to use a VNH2SP30 DC motor shield with MobiFlight
- Using 3D printer mainboards
- Playing sounds by sending keystrokes to AutoHotKey
- Using the selector knob on a Honeycomb Bravo
- Using an adjustable 12 position switch as a GA starter
- Brightness of LCD displays with I2C
- Using three-position switches
- Transponder with one Rotary
- Workflow for Creating Flight Simulation Panels ‐ Part 1
- MSFS2020 RPN Tips and Tricks
- MSFS2020 Using the Custom Input Code Box
- MSFS2020 Install WASM module and Event List
- MSFS2020 How to Create and Use User Defined Lvars
- MSFS2020 How to Create a Blinking LED configuration
- MSFS2020 User Defined WASM Module Events Best Practices
- MSFS2020 Developer Mode, Model Behavior dialog and Console window
- MSFS2020 PMDG 737‐700 List of Events that require use of FSUIPC7
- MSFS2020 PMDG 737‐700 Calibrate throttle idle and reverse thrust using interpolation (Valkyrie)
- MSFS2020 PMDG 737-700 Chrono unit functions implemented in Mobiflight
- Configuring PMDG 737 Parking Brake Lever Auto-Release with a Servo in Mobiflight
- Using encoder to drive a value back and forth within a given range
- Adding a custom board to MobiFlight
- User guide - Community Board and Custom Devices
- Developing your own custom devices/boards