I have a rotary encoder set up on arduino mega. It works great when I test it on left turn - Com_Radio_Whole_Dec (event 65636, para 0) and right turn Com_Radio_Whole_Inc (event 65637, para 0) using event presets. Works as it should so I know my rotary is hooked up and working ok as well as MF Connect etc etc.

My problem comes when I change the event IDs to the OH_Press_Flt_alt_knob events.

I assign event 69850 to right (increase) and 69851 left (decrease) both with parameter 0. Nothing happens on FSX when I turn the encoder. Mobiflight reports the right/left action but the Flight Alt display on FSX doesn't change. I've tried stopping and starting Mobiflight after changes and also a variety of parameters. (1, 1000, 500, 5000 and various other combinations with + & - in front of various integers). I suspect I have not entered the correct parameter but otherwise no luck. MF shows FSUIPC & FSX connected and other configurations eg LEDs work as they should.

Sort of run out of ideas now. Any suggestions would be greatly appreciated.

Left turn (69850) counts down perfectly with Parameter 536870912 (which equals a left mouse click). However when I configure the right turn with event 69851 parameter -2147483648 (which is the output for a right click as shown in the log output) the display will not count up. At the back of the list right-single mouse click does not have a '-' at the start but MF will not let me use just 2147483648. I get an error message "Value must be a number between -2147483648 and 2147483647."

It's the numerical value of the right single mouse click: 2,147,483,648
This numerical value is exactly 1 above the maximum range of the signed long INT range.

Binary this area goes to 0111 1111 1111 1111 1111 1111 1111 1111,
These are (+)2,147,483,647. As you can see, the MSB is 0, which is why the number is considered a positive number. If 1 is added, we have

1000 0000 0000 0000 0000 0000 0000 0000

If the sign is negative and the rest of all bits is 0. So -0. 0, mathematically speaking, can not be negative, so an error is output.

If, however, the 2.147.483.648 is preceded by a minus (-), then it is almost the smallest representable number of -2,147,483,648, so the result is -2,147,483,648, which is binary 1000 0000 0000 0000 0000 0000 0000 0000. Mobiflight can take this value.

So much for explaining why (only) this value must be negative.

Where did you actually get the EventID 69751 from? According to my documents, that is not forgiven or documented.

Please try also for the clockwise rotation (increase) the EventID 69850 and the parameter -2147483648. That should work

Everything works great now thanks to your guidance. It never crossed my mind the event number should have been the same for left and right. Hours of experimenting and I missed it.

I assumed event no 69751 was correct because in the document PMDG 737NGX Custom Event ID's SP1d Cockpit Builder edition, it gives event ID 69850 for EVT_OH_PRESS_FLT_ALT_KNOB which needs two inputs, increase and decrease. The next event listed was 69852 so I assumed 69851 was assigned to increase (right) with 69850 decrease (left). Similar to the way the list of offsets are given in the document Offset Mapping for PMDG 737NGX. Where an offset is given for a multiple item it only gives the first offset, the second being implied. For example, there are two landing light switches - LTS_LandingLtFixedSw. Offset 64F4 is given but not 64F5 which is used for the second switch. The next item is allocated 64F6. So therein lies the reason for my wrong assumption with event IDs.

Just so it's clear for anyone else who who may not know how to configure Mobiflight for an encoder to increase/decrease a FSX/P3D non standard digital display:

1. Attach your encoder (usually two arduino pins and GND)
2. Open Mobiflight and go to Settings - Mobiflight Modules
3. Add a new device - Encoder. Give it a name and enter your pin nos.
4. Upload to the Arduino.
5. Go to Inputs and add a new config.
6. Go to Edit. On left & right tabs enter the Event ID and this is the key bit...For parameter you need to enter the respective 'Mouse Flag for mouse simulated events' found on the last page of the document PMDG 737NGX Custom Event ID's SP1d Cockpit Builder edition. In this case 536870912 for left click (decrease) and -2147483648 for right click (increase). Ignore fast left & right tabs, PMDG doesn't support them.
7. Activate the item and set Mobiflight to run and test your encoder.

For the sake of completeness:
In this case, it is true that there is only one EventID for both counting up and down counting. But this is the exception!
The rule is that, as you suspected, there are two EventIDs. But no rule without exception.
The offsets (0x ....) are easier. There is always at how many bytes are needed for it and if square gulls [.] Are there, special care is required, because this then counts several times (or even for the FO).

Further success in your construction projects! If you have questions, you know ...
Thanks for your nice feedback.

The EventID means normaly a "internal Sequence" that is done by FSUIPC... (Or better explaned a sequence that is done by the Sim internal)

Your Right... The FSX Standard Events normaly are all "Execute Events" .... They use no Parameter ( No matter if you use 0,1,2 or 9999999 ) ALL Parameters start the same event there. So this Standard Events normaly do ONE THING.... Means you got a Event for Increase and a other for decrease .
PMDG is a AddOn and the Table of EventID is verry limmited that PMDG can use ( supported by FSX/FSUIPC) .... So PMDG work with a different logic....
In PMDG a Event is normaly Fixed to ONE ELEMENT.... Like Event 69850 is the Press FLT ALT Knob .... And ALL You will do here ( Increase, decrease etc) is done by the SAME Event but now with different Parameters ! So PMDG can handle much more things with less ID´s in use.

Last Note:
Most of Encoders in PMDG work in best result when you use the MOUSE WHEEL Controlls.
( Left/Rigth Click will work too... But Mousewheel give better "Fast Turn" results i think )
So check out for Mousewheel Up / Down Parameters 16384/8192
Look Up ! Some Elements will not work with Wheel Parameters.... (For example the N1 Speed selector if i remeber right)