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! 

icon
Avatar
Mazz1983
Posts: 8
Good evening Captains, before the question itself, here's my situation:
I have a full homemade C172 radio stack, perfectly working with FSX.
On the DME, I have a Max7219 display, number 1 in a daisy chain of 3, where the first 3 digits show the NM and the last 3 show the KTS.
Now, I instructed Mobiflight to put the decimal point between the 2nd and 3rd number, like 24.5, but if let's say the value is 103 NM, it shows me 10.3 because of that.
Is there a way to make the decimal point appear only if needed?
Thanks in advance.
2018-05-29 19:46
Avatar
Mazz1983
Posts: 8
Here a link to an image of the radio stack for better understanding.
https://ibb.co/fXz63J
2018-05-29 19:47
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 4844
Supporter
Yes !

I hope i understand correct... The Display should show with 3 Diggits the Value.
IF Value is between 10,0 and 99,9 it should use a decimal Point between digit 2 and 3 like XX.Y
IF Value is between 0,1 and 9,9 it should show nothing on Digit 1 and already a decimal olike above .... like _X.Y
IF Value is 100 or above it should ignore the Decimal part (Not shure if there is a decimal part finaly in raw date here) ... AND the Decimal Point should be not visible.

Your Problem....
Mobiflight work with a Hardcoded Decimal Point .... and Values on a Max Display are always FULL Numbers internal.
If Raw Date is for example 13,5 you will se on Disply just "13" ( Cause Mobiflight IGNORE all behind the full number)
To Show 13,5 you use the Hardcoded decimal ( by clicking checkmark active at this diggit) and you MULTIPLY the Raw Value by 10 in that case.
so 13,5 *10 is 135 .... In Real your display show 135 .... But The Hardcoded decimal is On now and Display look like 13,5

Result.... If Value is 100 or more then your decimal is ON, too. So 100 is 10,0 again,

***
Solution.
You must work with TWO Configs ... controlled by a precondition each. Both use the SAME Display diggits !
One Include the Decimal Point and should work only if value is below 100
the other have no decimal active and work only if value is 100 or above.

Final Problem. I never try out this with a STRG Value. ( Look like DME Distance is STRG Offset 0C29 and 0C2E ( Both 5 Bytes)
Not shure if its possible to make a precondition with a String Value as indicator (cause its Text basicly)

***
i recommend....

1. Try to work with Offset 0C29 and 0c2E ... Hwat give better results and whats the difference.... One should include a Decimal.... How does it looks like in Mobiflight FSUIPC Value line ??
2. Try to make a Precondition like explane above ( i would use 0C2E 5Byte DME1 speed as character string, “nnn” followed by either space then zero or just zero )

Please report experience.... If needed i can check this next time.

****
@ Albeagle @ Hannes .... Wie habt ihr das gemacht ?

.
Good Luck !
2018-05-30 00:26
Avatar
albeagle
From: Kosovo
Posts: 118
Momentan habe ich kein Rechner da, mein Rechner mit allen daten liegt bei einem Freund von mir aber:

@Mazz1983 I suggest you check the config file I have uploaded in my website, which will help you a lot with the offsets I have used so you can play with them.

Here is the link to the config file:

https://flyingforfun.weebly.com/uploads/6/5/4/1/65412923/mobiflightcessna172latest.mcc

And here is the link to the .mfmc file:

https://flyingforfun.weebly.com/uploads/6/5/4/1/65412923/kryesori.mfmc

To download the files, just right click on the above links and click save link as... to save it to your PC.
Regards
AlbEagle

http://flyingforfun.weebly.com/cessna-172-cockpit.html
2018-05-30 04:20
Avatar
Mazz1983
Posts: 8
@pizman82
You guessed right, that's what I wanted.
I used offset 0x0300 (Int, 2 Bytes) for that because in my offset list the offset 0c29 description says "DME1 distance as character string, either “nn.n” or “nnn.” (when > 99.9 nm). The 5th character may be a zero or a space. Don’t rely on it.", so I didn't rely on it :D
By the way tonight I will try your suggestion and keep you updated, thanks for your time.

@albeagle
I'll check your files tonight, thank you for your time.
P.S.: I'm a fan of your site!
2018-05-30 08:11
Avatar
Mazz1983
Posts: 8
@pizman82
I followed your advice, or at least I think I did it.
I created the two Outputs, one with the decimal (precon. if value >1000) and one without it (precon. if value <=999), then the two empty preconditions.
BUUUUT it doesn't work. Where am I wrong? :confused:

Here a link to my .mcc file.
https://uploadfiles.io/4ll34
2018-05-30 15:47
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 4844
Supporter
Sorry friend.

I just make a short SHIFT-F Search in the pdf and that was my first hit ( Maby cause i was with cursor somwehere in the middle from a other search )

Your right.... Offset : 0300 2Byte VOR1 DME distance, 16-bit integer, nm * 10 is better here.
(Whatever the STRG Values should be the easy way if you show it on a LCD Display instead of a LED 7 Segment.. Cuase here a TEXT is better as a INTEGER )

So i not try Albeagles Config ( Just read the code with text editor) BUT it looks he use 0300, too.
At first view i not see directly if he include this decimal On/OFF Logic....
If YES simply duplicate his system..... If NOT then do the follow workflow.....

****
1. Check out the logic of Offset 0300 (Only if you not already understand it youreself)
Create a new Mobiflight File.... Make a Output Config for 0300 2 Byte INT
Run Mobiflight and Sim.
Now just check the Field "FSUIPC VALUE" in Mobiflight Output Tab,
Get your aircraft to a point you can test Distance from 0 - 100+ (With z quick move to save time)

The description in FSUIPC means "0300 2 VOR1 DME distance, 16-bit integer, nm * 10
So 0,5nm should be value "5" ... 57,3nm should be 573 for example.
Now just check what happen if you over 100nm distance.... 101 Miles should be a value of 1010 !
Does here the last number change in 0,1 Mile Steps to.... So it goes from 1010 to 1011 to 1012 and so on until reach next full 1020....
OR
Does here like in FSX Gauge only full miles Steps happen..... So after 101 Mile Value 1010 the next value is 1020 for 102 Miles ?? ( No steps between internal)

****
For the Config:
Now its like i told you in last posting. ( Now its integer and precon should work 100%)

- Create 2 Output Configs... Named for example DMEDistLow and DMEDistHigh
- Both Configs use Offset 0300 2 Byte INT ( No transform)
-Both Configs use Device : Your Display and the needed diggits. ( Both the SAME Display)
Config "low" use a decimal Point here ..... Config High use NO Decimal Point Left Padding Space should be the best option for both Displays !!

- Config Low get Precondition : Only work IF Config DMEDistHigh <1000 ( Here you must use the OTHER Config as indicator cause you can not use the current config itself as its own precondition.... Thats a little bad system of mobiflight)
-Config High get Precondition : Only work if Config DMEDistLow >999 ( Again the other Config for preconditioning.... not be confused )

Thats It ... This should work ! .... Whatever there is a changing Decimal Number over 100 in original value.... Your 3 Diggit Display will show 101 ... Whatever value is 101x... the 4. Number is simply not showed in case of missing digit space .

Please report finaly if this workes to help other users in the future !
Good Luck !
2018-05-31 04:35
Avatar
Mazz1983
Posts: 8
@pizman82
Many many thanks, I was slightly there, but not completely.
I followed your instructions and it works without problem.
Marked as SOLVED, thanks again for your help.
2018-05-31 08:57
icon