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
smartarze
Posts: 14
I Have my comm displaying on a 7 segment display and i'm controlling with an encoder. The display is working fine and displaying exactly what the comm in the zibo is showing, If i tune the radio using the mouse in the sim all ok. If i tune using my encoder the comm frequency jumps up in 5s, for example if i have 121.700 showing on my display and i turn my encoder 1 click i get 121.750. How do i get it to go up in 1s eg 121.700, 121.710, 121.720..........

seperate question

The zibo comm climbs in 0.5s eg 121.700, 121.705, 121.710, 121.715, is there a way to do that or is the last 5 ingored in most cases?

Any help appreciated, spent hours and hours trying to figure this out

Ian
2019-12-18 02:23
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3322
Supporter
Hi

Here we talk about the "Spacing"

- 0,5 steps is the verry old 50Khz Spacing from early 1950's ....
- 0,25 Steps are the system that is used global until some years ago and already today in parts of the world.... Here we talk about 120.00 - 120,02 - 120.05 - 120,07 120,10
- 0,05 Steps basicly not exist.... This are rounded Values and not include every 0,05 steps cause here we talk about the "8,33Khz" Spacing.

For detailed Information please google for "Frequency spacing 8,33"

About your Problem.

I not know how Xplane handle this..... In FSX there is no implementation of 8,33 Band.... So the maximum is 25khz.
Whatever Yplane maby support 8,33 then XPUIPC is the problem cause it based on FSUIPC and that is like the FSX not be able to handle 8,33 Band.
Finaly your Zibo can be the Problem. The showed Frequency "can" be a internal value and not is identical with the used frequency in sim ( simply rounded to next 0,25 step) .

Solutiion:
Try to include the Event for Zibo in XPUIPC..... So you change Frequency NOT via Xplane logic..... then you change it in Zobo itself as you do it with the mouse.
Good Luck !
2019-12-18 06:29
Avatar
smartarze
Posts: 14
Hi thankyou

That explains why i've been having trouble, I spent many hours looking round for the answer but mostly what i read was about fsx or p3d and not xplane. I don't fully understand about implementing datarefs into xpuipc yet, no matter how much i spend reading about it the imformation wont go into my thick head lol. I'm still on the lookout for a video explaining that if anyone knows of any they can link me to. In the meantime i'll keep having a play with datarefs and xpuipc and hopefully by pure luck i'll figure something out that can then be repeated for any other issues i might come across in future.

many thanks

Ian
2019-12-19 02:51
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3322
Supporter
2019-12-19 03:44
Avatar
smartarze
Posts: 14
thanks again

Just what i needed, I have managed to follow along and get bits and pieces working, The only thing is, the tutorial is detailed on annunciators and switches doesn't go into detail about a 7 segment display. Here's what i have in my XPUIPCoffsets.cfg

Dataref com1standbyfrequency sim/cockpit2/radios/actuators/com1_standby_frequency_hz float
Offset 0x6001 FLOAT32 1 rw $com1standbyfrequency

I have also posted at the bottom of the tutorial incase someone in the know reads it.

Ian
2019-12-19 05:46
Avatar
smartarze
Posts: 14
Update

I've managed to get the above working by changing it from float to int

My display now shows correctly to a point including the end 5, however it only displays correctly up to 131.065

I'm using transform $+65536 which works great from 118.000 to 131.065, When tuning up to the next digit (131.075) my 7 segment shows 655.390 This is because the FSUIPC value in mobiflight rolls over from 65529 (131.065) to 3 (131.075) so the transform value no longer applies. A transform value of $+131072 works for 131.075 to 136.990 but then goes wrong when the digit in tuned up and goes to 118.000

It's almost like I need 2 transform values to work or a way to alter the FSUIPC value in mobiflight, Or go back to the drawing board and find a completly different way
[Last edited by smartarze, 2019-12-19 07:08]
2019-12-19 06:50
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3322
Supporter
Here the Problem is the XPUIPC Logic.

So i not understand at the moment why you need here adding 65536 .... Also not why you need INT instead of Float like listed and so on.

*******
I Recommend.....
Not make a stange logic. Maby you just not understand the system and the basic logic is still 100% Correct.
WHAT is the FSUIPC Value ( Raw Offset Readout) when you use no transform AND you use correctly FLOAT 4 Byte

I am pretty sure thats the key..... You just use wrong fromat.
So try out this at first !!!!


If you realy need this transform as you explane then a IF Condition is your solution.
Here you must find out a "indicator" how the raw value looks like for condition A and Condition B
Like IF Raw Value is Less then xxxxxx then $+65536 ELSE $+131072
Syntax is for example .... if($>?????,$+65536,$+131072) ------ ?????? means the raw value where the first condition must resulting.
Good Luck !
2019-12-19 10:48
Avatar
smartarze
Posts: 14
You are correct I don't understand the system, I've never used anything like this before but thats why im here learning, everything i get to work i learn from. Yesterday I couldn't do any datarefs etc but now I know how to get a few working. I'm trying to do one of everykind so i can get my head around each, eg 1 button, 1 encoder, 1 seven segment, 1 toggle, 1 3way, 1 rotary

The reason I used int is because when i use float nothing happens, The mobi flight fsuipc value sits at 0 and doesn't move, maybe the following is not the correct way to write a float value?

Dataref com1standbyfrequency sim/cockpit2/radios/actuators/com1_standby_frequency_hz float
Offset 0x6001 FLOAT32 1 rw $com1standbyfrequency

appreciate your efforts to help

Ian
[Last edited by smartarze, 2019-12-19 12:38]
2019-12-19 11:31
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3322
Supporter
A i said.... i not use XPUIPC..... So i can not directly help.

If i need to do this myself i would simply testing.

At first you must know..... Mobiflight AND Xpuipc must work simmular.
So if you choose Float32 in the XPUIPC Config File to support a Data to that Offset THEN you must also do this in Mobiflight. You Read that Adress here so it must be same typ.
If you try to Read a Float Value as a INT it can not work.

So my testing ground would be simple.....
In Mobiflight i would make a testing Config..... No Devices like Displays needed..... Just the Connector to test Values.
Open a new config.
Create 5 Output Configs.
C1 Read Offset 6001 As Typ INT 1 Byte
C2 Read Offset 6001 As Typ INT 2 Byte
C3 Read Offset 5001 As Typ INT 4 Byte
C4 Read Offset 6001 As Typ FLT32 (4 Byte)
C5 Read Offset 6001 As Typ FLT64 ( 8 Byte)
Save This Config

NOW you got a testing Ground. You can Run Mobiflight with this File ..... You can choose only one of the configlines or you active all.... No matter.

If you now create a Element like your Com1Stby then try in XPUIPC Typ FLT32
Then Run Mobiflight and check what of the Configs ( Offsettyps) make sense. Are they all Zero then XPUIPC did something wrong. Maby you see that FLT64 is the correct one maby the other.
If no good result is there then change in XPUIPC Datatyp to for example INT 4 Byte and check again the Result.

Basicly you must find out..... What Format is the DataRef (Raw) ..... And What format of Offset must be choose to export the value in a correct form.

In example of Com1 Frequency.....
In Sim it is for example 121,515 ..... So Value can be a Float like 121,515 it can be a INT like 121515 . It can be a INt without leading Zero 21515 .
It can be a Float with other system like 1,21515 it is maby a complete below Zero Float like 0,121515 and so on.

*****************
Summary.... You can try to google for a premade solution or a guy who explane you all that stuff..... Or you startup with testing and learn it youreself !
Good Luck !
2019-12-19 12:39
Avatar
smartarze
Posts: 14
thank you so much, I now having it working 99% thanks to your explanation about setting up the test. Its working without any transform value which is great. The only slight niggle i have now is when turning the encoder the fsuipc value jumps to something random for a split second every few turns of the encoder, this obviously also shows on my display. I have tried 3 different encoders and they all do the same. Is this a bug in the software?

I have no other outputs or inputs set in mobiflight.
[Last edited by smartarze, 2019-12-19 13:51]
2019-12-19 13:39
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3322
Supporter
1. What kind of INPUT do you use ?
2. Does the problem also happen if you change frequency in Virtual Cockpit by Mouse ??


Basicly you must understand..... Mobiflight is just a "stupid" programm that do all time the same again! It read the Offset you tell him multiple time per second and it show the Data to a Device (7 Seg in your case)

If you turn the encoder, then the output config that controll the Display basicly not care about..... It do the same as if you not turn the encoder..... It simply read Offset 6001 in the Typ you tell him and show the Data.
So the "random" trash that is shown on your display is pretty sure just the data of that Offset in that short periode of time..... Means if you change the Frequency then "someone" will write the data on Offset 6001 for a short moment to this "stupid" number before it update it with correct value shortly behind.

To find out what happen the first question is....
Does the Virtual Display in Cockpit show also shortly that random stuff..... If Yes then the problem is still in Xplane.
If not then check the next spot.
Does the FSUIPC or OUTPUT Column in Mobiflight Connector show also the "random" thing for a short moment when you turn encoder ?
Pretty sure yes.... Cause as i said above the display just show what Value of offset represent.
Then the Problem is maby XPUIPC ..... Cause it read the correct Data from Dataref BUT send to FSUIPC Offset a wrong data for a short moment.
******

To solve.... Make testings again. Try to change Input Type. For example Input by writing a Offset ( that is also read for Display) can occure in trouble. Try to use Commands or Joystick/Key Inputs instead.
Good Luck !
2019-12-19 19:41
Avatar
smartarze
Posts: 14
Sorry i did mean to say that the fsuipc value in mobiflight does also jump to a random number as you said. If i roll the value with the mouse its all fine, only happens when using the encoder. I have 2 no name encoders and a ky-040 encoder. It happens with all of them. Will do some more testing another day my brain is fried for today.....its been a long learning session.
2019-12-19 21:16
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3322
Supporter
Ok

Some Hints for your next seasson.....

1. There exit no random thing in in a Logik. The "wrong" number pretty sure make sense.... Whatever you not see it at the moment. But pretty sure its not "random".

2. As i said above please tell us HOW you make the Input.... Do you controll the same Offset by a Write logic or do you send Joystickbuttons, Keys etc.... Or do you work with the "command" system of XPUIPC ?

3. Do you use the same system for Input and Output ??
On first view your Dataref called "sim/cockpit2/radios/actuators/com1_standby_frequency_hz float"
I not know the folder logic but i not read Zibo there.... So i think your dataref is a "standard" Value from Xplane.
If your input now controll a Zibo Internal Value then maby this is the issue....
You can find out if Zibo maby also support a Dataref for its OWN Frequency Data OR you can do your Input to the Standard Xplane Dataref instead of the Zibo Input.
Mixing Systems offten occure in problems!
Good Luck !
2019-12-20 02:50
icon