**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!

12

Hello Pizman,

I tried the third part of your explanation and works fine with offset 66D0. Thank you very much, you're genious. Have a good day.

Best regards.

Albert

I tried the third part of your explanation and works fine with offset 66D0. Thank you very much, you're genious. Have a good day.

Best regards.

Albert

2020-04-15 09:33

Wonderfull

just a last Idea....

As i wrote in initial Posting some years ago.... I think this System for swapp between MHZ and KHZ for all radios ( Com1,Com2,Nav1,Nav2,ADF) can get combined.

You will not change with two hands same time Com1 and Com2.... So its not needed to have a single swap Logic for each Function.

I recommend....

Use only ONE Offset for all Systems .... Call it for example "Radio Swap Status" on 66D0 1 Byte.

All Encoder-Configs ( Whatever Com1, Com2, Nav1 Nav2 and so on) use the SAME Offset as Precondition Indicator.... 0 for one function like Khz.... 1 for the other like Mhz.

On other side you use for all Push Buttons a own input Config.... BUT All configs will write the same Offset ( 66D0)

Result:

If you press one of the Encoder Buttons ( No matter of wich encoder) you always Toggle bettween Mhz and Khz of ALL other Encoders, too... This is no problem cause you not use the others..... So its no mater if they also swap. .... Big benefit.... You need only one Offset finaly !

just a last Idea....

As i wrote in initial Posting some years ago.... I think this System for swapp between MHZ and KHZ for all radios ( Com1,Com2,Nav1,Nav2,ADF) can get combined.

You will not change with two hands same time Com1 and Com2.... So its not needed to have a single swap Logic for each Function.

I recommend....

Use only ONE Offset for all Systems .... Call it for example "Radio Swap Status" on 66D0 1 Byte.

All Encoder-Configs ( Whatever Com1, Com2, Nav1 Nav2 and so on) use the SAME Offset as Precondition Indicator.... 0 for one function like Khz.... 1 for the other like Mhz.

On other side you use for all Push Buttons a own input Config.... BUT All configs will write the same Offset ( 66D0)

Result:

If you press one of the Encoder Buttons ( No matter of wich encoder) you always Toggle bettween Mhz and Khz of ALL other Encoders, too... This is no problem cause you not use the others..... So its no mater if they also swap. .... Big benefit.... You need only one Offset finaly !

Good Luck !

2020-04-15 19:03

Good idea, I'll try this in the future. Many thanks.

Best regards

Albert

Best regards

Albert

2020-04-15 20:33

Hello Pizman82, I tried what suggested to me on last reply and it works perfectly. Thanks a lot.

Best regards

Best regards

2020-04-21 14:23

Can someone please translate this logic to English? Value= if($>=1800,if($%5==0,$-3,$-2),3697)

It's a nested if, but probably confusing because I don't understand the %5 bit.

Mike

It's a nested if, but probably confusing because I don't understand the %5 bit.

Mike

2020-06-17 02:41

Hi

1. Its recommend to use EventID instead of Offset.... Cause its more easy....

2. If you use a AddOn check if your AddOn itself support a own Input.

**3. About your formula. It looks wrong..... It should be if($>1800.... ) not if($>=1800....) The "=" here is wrong an result in a issue at Leftturn at 118.00 Mhz.**

also the "double == in the second part is not needed i think..... here a single "=" is enough as i know)

Please tell me WHERE you get this formula !!!

4. "%" is the mathematic Symbol for "Modulo" This is a kind of math action like Addition, subtraction and so on.

Modulo means you devide a number "a" through a other number "b" and the Result is finaly the residue that could not be deivide.

For Example 100 Modulo 30 100%30 is 10 .... Cause 100 can be dived 3 times through 30 ( 90) and then a rest of 10 result but can not be divide again.

In the Com Formula this means..... "$%5=0,$-3,$-2" So if $ ( The current readed frequency) divide through 5 result in 0 THEN Reduce Value by 3 Else ( If Modulo result in a rest of NOT Zero) then reduce 2.

This is used to rebuild the last number that is x.x0 or x.x2 or x.x5 or x.x7

You see if moduu is Zero here the number is 0 or 5 .... So a Minus 3 result in a 7 or 2

If number would be 2 or 7 the modulo is "NOT Zero" so the result is a Minus2 ..... And that result in a correct 5 or 0 again.

1. Its recommend to use EventID instead of Offset.... Cause its more easy....

2. If you use a AddOn check if your AddOn itself support a own Input.

also the "double == in the second part is not needed i think..... here a single "=" is enough as i know)

Please tell me WHERE you get this formula !!!

4. "%" is the mathematic Symbol for "Modulo" This is a kind of math action like Addition, subtraction and so on.

Modulo means you devide a number "a" through a other number "b" and the Result is finaly the residue that could not be deivide.

For Example 100 Modulo 30 100%30 is 10 .... Cause 100 can be dived 3 times through 30 ( 90) and then a rest of 10 result but can not be divide again.

In the Com Formula this means..... "$%5=0,$-3,$-2" So if $ ( The current readed frequency) divide through 5 result in 0 THEN Reduce Value by 3 Else ( If Modulo result in a rest of NOT Zero) then reduce 2.

This is used to rebuild the last number that is x.x0 or x.x2 or x.x5 or x.x7

You see if moduu is Zero here the number is 0 or 5 .... So a Minus 3 result in a 7 or 2

If number would be 2 or 7 the modulo is "NOT Zero" so the result is a Minus2 ..... And that result in a correct 5 or 0 again.

Good Luck !

2020-06-17 03:49

Thanks!

This code is from the config posted for this project. I'm just building this project piece by piece to learn more about MF.

Mike

This code is from the config posted for this project. I'm just building this project piece by piece to learn more about MF.

Mike

2020-06-17 05:03

12