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! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

Go to page 1Go to page 1123Go to page 3Go to page 3
Avatar
bennnozgurum
Posts: 58
Hi my friend I am here to help. Just ask me what you need specificly. Do not forget we need Lua codes to get some output like Altitude and Heading and inputs. If you have problem, just ask me specificly. These are the Lua's for MCP input that you searched for:
LNAV= L:lnav_clicked
VNAV= L:vnav_clicked
I used FSUIPC macro input action for FLCH button, but it works only in FSX not P3D.

Most of the inputs use Lua but some of them also works by default FSX actions. Do not forget if you want to have stable MCP for our bird QW757, we should use the luas in the aircraft.
[Last edited by bennnozgurum, 2020-07-21 23:57]
2020-07-21 23:39
Avatar
flyingjayaraj
Posts: 25
@bennnozgurum

Thanks a lot for the reply Capt,

The update on my MCP as of now that, i have been able to assign all the keys, I have used the LUAs the MCP input and as you suggested i have assigned FLCH via a Mouse macro, they seem to work flawlessly :)

For the EPR i am able to get the light to illuminate on Button Press, but unable to get the thrust to move, so i assigned it TOGA power on button release, so at least i have to annunciation on the ADI with an increase in thrust.

Now my biggest problem is the Seven Segment -Altitude Display. - output :confused:

The 7 Segment - has its own PINs ( 5-6-7)
I have given it a separate ground connection direct into the board
Only the Power is daisy chained.
Upon Test - the 7 segment works fine, just wanted to rule out any defects.
Unit brightness - 75%
MS - FSX - Windows 8.1 - FSUIPC - 4.9 latest
Both MobiFlight & FSX run in Admin mode

The encoder works fine, i am using the event IDs and the altitude in the Sim increases and decreases,
But the Altitude read out on the 7-Segment is not matching.
Some times it will match, then it will get stuck at "Zero" or it will just read something vague and then it just stops working

I am using the Offset - 07D4 with the default TRANSFORM settings.
No Pre-Condtions or Compare Values set

would be great if we could exchange the Offsets used & Pre Conditons - Shall give it a shot and see if its works
Only the altitude output remains post that the MCP is almost done.

Regards
Aj
2020-07-24 14:01
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
iconflyingjayaraj:


The 7 Segment - has its own PINs ( 5-6-7)
I have given it a separate ground connection direct into the board
Only the Power is daisy chained.



Hi

About the Offset.... Here Özgür can help you much more....

But about the Electrical side. Your wrong ( or you explaned wrong way)

You can daisy chain everthing EXPECT the power line. So you can chain CLK, CS, DIN and GRD.... But you can NOT chain 5V.
5V must be wire direct to each board ( or you rework the Tubes by desolder the diode)
Good Luck !
2020-07-25 01:26
Avatar
flyingjayaraj
Posts: 25
@pizman82

Thanks for the input, I shall rewire the power supply and ensure that each 7segment has its own power supply, either from the board or from external power

Hope that does the trick :)
2020-07-25 03:37
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Whatever other users recommend that.... Stephan run 12 Displays with one Mega and have NO external Power. This should be not a problem at all.

If you want to use external Power please get sure you share the Grounds !

So if you use External 5V to the MaxTubes then you must wire the GRD also to the external Suply AND you must wire the GRD of the Suply to a GRD Pin of the Mega !
The Mega must run with the same GRD potential like the Suply that power a Element ( Display in your case) that is connected to that Mega !

So.... 5v External Suply to EACH MaxTube in the Chain as a single line. GRD Power Suply to Maxtube1 in the Chain ( Here GRD can be Chained through the tubes) AND GRD Power Suply to a empty GRD Pin on the Mega !
Good Luck !
2020-07-25 10:53
Avatar
bennnozgurum
Posts: 58
Hello my friend,

I also learned the electrical side of the work from my friend pizman, so he is the expert on it. I also got an error when I daisy cain 3 7 segment module together. Then I did it as pizman's advice and there was no problem.

As I said before, you can use some offsets like FSX original but if you want it stable, I will advice you 2 ways.

First one is using default altitude offset but with transform settings. However there is a bug when you use it. For example the airport elevation is 3000 feet when your altitude comes to 3000ft it stops unless you use VS encoder and it comes alive again. (The original Alt value transform settings of fsx is: "$*3.28084/65536" I don't remember actually but I changed the 3.28084 with "3.28085-3.28090" you should try and see the result.

Second one is I get the original Lua output code and write it to one of FSUIPC free offset. Do not forget I also did the heading this way because it also doesnt match sometimes with the original one.
The output lua for Altitude: "L:alt_sel_num"
The output lua for Heading: "L:hdg_sel_dir"
These are not UB=UnsignetByte, they should be UD be careful when you write your .lua file to get it and write it to a free offset.
Since we get it from the actual lua output of the QW757 and write it to a free offset and mobi looks this free offset and shows it to us, there is a latency. It doesn't bother me but I should inform u before...
2020-07-25 15:08
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
iconbennnozgurum:

The original Alt value transform settings of fsx is: "$*3.28084/65536" I don't remember actually but I changed the 3.28084 with "3.28085-3.28090" you should try and see the result.



That sounds like a Rounding Problem..... this multiplication is need to convert Meters into feet. Also th 65536 is needed to handle FSX Hexadecimal system.

I never try out myself..... But you can check something like Round($*3.28084/65536,0)
Good Luck !
2020-07-25 15:34
Avatar
flyingjayaraj
Posts: 25
@bennnozgurum
@pizman82

Thank you for the detailed reply - Shall troubleshoot as advised

1) The power supply & Shared Grounding ( 7 Segment + External Power Supply + Arduino )

After rectifying the power supply shall try the 02 Option suggested by @bennnozgurum

2) a - Use the default Offset with the suggested transform settings (or)
b - Use the Output Lua Code and write one to an free offset

Shall update how this works,
regards
AJ
2020-07-25 16:09
Avatar
flyingjayaraj
Posts: 25
@pizman82
Is there a sticky / post that deals on how to write
A Lua script and assign it to a Free FSUIPC Offset.
Shall try what @bennnozgurum has suggested.
2020-07-26 12:46
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
2020-07-26 15:24
Avatar
flyingjayaraj
Posts: 25
This is the code that i have come up with, have made a Lua file and placed it inside the modules folder -

first = true

while true do
if first then
initialALTVal = ipc.readLvar("L:alt_sel_num")
ipc.writeUD(0x66C0, initialALTVal)
first = false
else
currentALTVal = ipc.readUD(0x66C0)
ipc.writeLvar("L:alt_sel_num", currentALTVal)
end
end

hope this would do the job ?
2020-07-26 17:55
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Now Benno is on the turn.

I could give you the link but i never write those scripts myself !
Good Luck !
2020-07-27 00:39
Avatar
flyingjayaraj
Posts: 25
Shall wait for @ bennnozgurum to check the script, have also added a script to execute it automatically, but once I assign the offset I don’t get any display on the 7segment
2020-07-27 15:23
Avatar
flyingjayaraj
Posts: 25
Still no luck on how to go about the script, have posted in few forums for assistance, :-/

@ bennnozgurum
2020-08-03 18:24
Avatar
flyingjayaraj
Posts: 25
Finally had some good luck with the code - thought i shall share it with the community @pizman82 @bennnozgurum

To read a L:var and write that data into an free FSUIPC Offset (0x66C0)
Create a Lua file - in the modules folder - in my-case - B757200.lua - with the code

while true do
n=ipc.readLvar("L:alt_sel_num")
ipc.writeUD(0x66C0,n)
ipc.sleep(100)
end

Replace the values however it suits your requirement. and now in-order to run the script automatically - add a section in the - FSUIPC.INI FILE

[Auto]
1=Lua B75200

This worked for me :) now on to the next issue ;)
2020-08-04 21:42
Go to page 1Go to page 1123Go to page 3Go to page 3