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
Aviato
Posts: 9
I am trying to get the transponder going in X-plane. I searched but couldn't find what I was looking for. I have the digits working but how can I limit the range of the Squawk code? If I don't limit it, in x-plane it will go into not supported numbers, and Mobiflight stops running with an error in the input string. I need to limit it between 0000-7777.
I tried to change the value if($>0000,$-1,$+7777) But that didn't work. Any ideas?

Regards,

Kris
2020-09-12 09:57
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3728
Supporter
Hi
Please tell us more about your setup.
Do you use realy 1 Encoder to turn the whole Xpdr in "1" Steps ??? So in whorst case ~~3700 detents ??
Normaly we use 2 or 4 Encoders here . So each encoder turn only 1 digit or 2 .

Whatever with 1 encoder your formula looks techncial good. i would use if($>0,$-1,$+7777) ( Maybe the 0000 ocure in a syntax error)
Please get sure you activate BCD Mode here in that config !!
Good Luck !
2020-09-12 14:19
Avatar
Aviato
Posts: 9
Hi,

No, I will use one dual decoder or if I don't like that 2 dual encoders. The 1 step I was just testing what it does after digit 7777. But I just tried and still it goes to 7778 with ($>0,$-1,$+7777)

I now have:
offse:t 0x0354
Value Type: INT
Size in bytes: 2
Mask valua : 0XFFFF
Set value: if($>7777,$+1,$+0)
2020-09-12 15:21
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3728
Supporter
Again.... Please Confirm you Eneable the BCD Mode !!! (Checkmark)

Also the new quoted formula is wrong ! This can not work !
iconAviato:


Set value: if($>7777,$+1,$+0)



Current Readout Value ($) can never be bigger as 7777 And also $+0 is senseless.
Here the reported problem will happen.... Formula say "if value is bigger then 7777" means it will not execute also already on 7777..... and here you say ELSE $+0.
So on each value it will send the same value ($+0) and do nothing in the sim.


For the On RIGHT Clockwise setting that increase the Transponder you need something like: if($<7777,$+1,0) So if less then 7777 ad 1 if exactly 7777 set 0 .


EDIT Note: We talk about XPUIPC. Here lots of versions exist. I´m not sure if your Version works same like FSX/P3D with FSUIPC.
You need to test a little bit. I can just give you the logical ideas. If you get no success we must maby check this together via Shared screen!
[Last edited by pizman82, 2020-09-12 15:37]
Good Luck !
2020-09-12 15:30
Avatar
Aviato
Posts: 9
Sorry, yes I have BCD mode activated. I am still trying to wrap my head around all these codes but I am starting to understand a bit. Now with the adjusted value its getter better but have another weird issue. it goes from 7777 to 0000 like it should and then to 1000 on the 7 segment but 0001 in the sim?

So 7 segment: 7777-0000-1000-2000-3000
Sim: 7777-0000-0001-0002-0003
2020-09-12 15:59
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3728
Supporter
Thats normal if you NOT choose the correct settings.

At first a major rule..... If you Test a INPUT then always check the "virtual" Display..... Thats what you change.
If you check a Output (Display e.g.) then always use the Virtual Encoder and never your Real Device.
Always get sure you test only ONE part at a time and use the 100% corrct Virtual part for testing instead a second self build element..... Cause here you not know what of the two is the problem !


To solve..... Check the Setting for that Display..... I garantee you have "Left Padding" in mode "Zero" and the chckmark is disabled.
That mean a Value is filled with Zeros to the Right ( so many Displays you choose) . So MF do exactly what you tell it to do !

With Left Padding OFF Typ "Zero" Display will show 1 0 0 0 ( Zeros to the Right)
With Left Padding OFF Typ "Space" Display will show "1 _ _ _" (_ = Blanked Diggit)
With Left Padding ON Typ "Zero" Display will show "0 0 0 1" (Zeros to the Left)
With Left Padding ON Typ "Space" Display will show "_ _ _ 1" (_ = Blanked Diggit)
Good Luck !
2020-09-12 22:56
Avatar
Aviato
Posts: 9
Not sure what this forum would do without you! You really know everything :thumbup: . I got it working now, thank you very much. I have learned a lot only from this topic .
2020-09-13 10:19
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3728
Supporter
Thank You.
Your welcome.
Feel free to ask again if you get in trouble. Also think about join our Discord Server. Most problems can be solved with a short Voice Call more quickly.... And if you share your screen i can see a problem 10 times faster as by read a long topic here.
If you see me online just whisper.... Then i try to help !
Good Luck !
2020-09-13 23:39
Avatar
Aviato
Posts: 9
After getting the transponder working and the NAV radio, I now have a small issue with COM 1. I need to change the first digits 118-137

offset:0x311A
value: INT
Size in bytes: 2
Mask value with: 0xFFFF
Value: $-100 (on left) $+100 (on right)
BCD mode on
This works but after 136 its shows 137 on the 7 Segment for a second and then goes to 118. If I keep rotating the knob it goes all the way to 145 and if I let go it goes back to the normal range 118-137 How can if have the numbers only show 118-137? In the sim it shows the accurate numbers.

I also tried
offset:0x311B
value: INT
Size in bytes: 2
Mask value with: 0xFFFF
Value: if($>18,$-1,37) (on left) ($<37,$+1,18) (on right)
BCD mode on
But this keep reseting the value to where it started.
2020-09-17 20:29
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3728
Supporter
Your on the right way.... Whatever i´m not sure if XPUIPC work simular here.....
Maybe the issue is that XPUIPC not allow to write a "part" of the value here.
So your idea to write only the Mhz Positions is good.... But looks like it will not work as you said.... So we need to write the whole Offset maybe.

So combine the logic of Way 2 with the dataformat of way 1 and it "should" work.
So write the Whole COM1 Frequency.... Means 311A 2 Byte INT BCD ON.

Your formula now is for Mhz encoder....
On Left : if($<1900,$+1800,$-100) Means IF Value is below 119.000 ( So all 118.xxx freqeuncys) it will Add 1800 to the value.... Means it change from 118,xxx to 136,xxx
If the Value is 1900 or above it will reduce by 100 ..... So e.g. 119,xxx get to 118,xxx

On Right: if($>=3600,$-1800,$+100) If Value is equal 3600 or more ( so 136,xxx) then minus 1800 ( ocure in 118,xxx) Else $+100 So e.g. 123,xxx to 124,xxx

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

NOTE: I know this is bad.... Specialy for the khz you need a formula now with MODULO% cause we must add 3 or 2 khz whatever the current value is.
E.g. 120.075 Must add 3 to get into 120.100 ..... But 120.050 must add 2 to get into 120.075
Also note this "old" System not include the 6th diggit. And it also not include the XPLANE already used 6.33mhz System.
For example on right : if($%5=0,$+2,$+3)


I still build those radios for other Xplane Users..... I think the most profitable way here is to use KEY Commands..... So not write Offsets for COM1 and COM2..... Simply use the Xplane internal Systems and set in Keybinding there e.g. STRG+a for COM1Stby Mhz Decrease..... use STRG+b for COM1 Stby Mhz Increase and so on.
Then send with Mobiflight just the Keys. This is the most easy way and also unclude the 6.33 system and the "overdrive from 136 to 118

And finaly.... Without a rework of XPUIPC ( by a other user or youreself) it is not possible to show the most right 6th diggit in Mobiflight !!
Good Luck !
2020-09-17 22:28
Avatar
Aviato
Posts: 9
That worked perfectly! I already had the right numbers going with On left if($>1800,if($%5==0,$-3,$-2),3697) and On right if($<3697,if($%5==0,$+2,$+3),1800) . It works good now showing 6 numbers on the display. I want to keep using offsets so I have a universal profile between multiple simulators. I am not messing with 8.33khz for now. Thanks again!
2020-09-18 13:06
icon