Jump to content
The simFlight Network Forums
Sign in to follow this  
Fltbuff7197

Not a problem, just a request for LUA PMDG777

Recommended Posts

Hello fellow simmers....

 

I have ran logs, looked at Linda (too compl for me), , looked at fsinterrogate,  and can not figure out code needed to set PMDG777 MCP IAS speed.  This is the value I want to set automatically via lua x number of minutes from airport.

 

On the 777.... Using FSUIPC loggins (great tool), and the Offset and control documentation,  I have been able to figure out the below:

setting APP switch on 777 to fully automate inflight actions, I have flaps, gear and APP working.  I had DIST working as well which shows me minutes from destination airport...

 

 

I have all of this working fine on my stock 747, as well, setting all actions at departing airport where all I need to do is release brakes, plane will take off, raise flaps, gear, set APP, NAV1 sw, lower flaps gear, flare up, brake, reverse thrust and stop, totally unattended. 

 

I like math and tech challenges and able to log lots flight miles without me sitting at computer for hours,... which I why I do this.

 

Any help on control, lvars, offsets etc for 777's MCP would be greatly appreciated.

 

Bob Higgins

Edited by Fltbuff7197
corrections

Share this post


Link to post
Share on other sites
3 hours ago, Fltbuff7197 said:

Any help on control, lvars, offsets etc for 777's MCP would be greatly appreciated.

Both the PMDG 737NGX and the 777X have facilities to control everything through added controls, which can be assigned in FSUIPC as "<custom controls>". The number of the control is needed and can be calculated from the data given in the PMDG 777 SDK -- look for the file of type .h. The list is near the end, after all the data (read-only) values (which are all mapped to FSUIPC offsets if the SDK option is enabled in PMDG).

However, I don't know if even those controls provide a way to set the MCP values directly. I think they operate in the same way as using the mouse -- ie by incrementing or decrementing the value. You could do that in a loop, reading the relevant offset, until you get the value you want.

The offsets are listed in a document provided in your FSUIPC Documents subfolder, in the Modules folder.

Pete

Share this post


Link to post
Share on other sites
6 hours ago, Fltbuff7197 said:

thanks, I saw the .h file but am confused on how to use it.  I like the incr decr idea.

I will rea]search some more to see if I can figure this out.

The list of controls at the end includes names, from which you need to find the one which sounds applicable to what you want to do. I think there'll only be one -- I think the difference between Increment and Decrement will be determined by the parameter, not the control number.

The way the control number is defined is as a "base" or starting number + a decimal number. The starting number is defined at the start of the list. Just add the two numbers together.

I don't have or use PMDG aircraft so I can't be more explicit, but take another look with what I jut said in mind and it should all come clear. (There are examples in User Contributions subforum for the 737NG I think.)

I don't know what the parameters are for increment and decrement. I think the increment may be obtained with something simple like 0 or 1 as  parameter, but decrement isn't something easy like 1 or -1. There are examples in other postings here, applicable to 737NGX or 777X -- they use the same parameters for these even if the control numbers are different. I think the parameters are based on the parameters the gauge itself would get from using the mouse (left click / right click), and those codes might be in the .h file too. If they are in 'hexadecimal', with maybe 8 digits, you can enter those in FSUIPC's parameter box by preceding them with an 'x' (eg 'x80000000').

And you might find more folks who can help more directly in the PMDG forum.

Pete

 

Share this post


Link to post
Share on other sites

Thanks for the quick and helpful repsonse Pete !

 

I love a challenge and will continue to pursue this until solved.

 

Yes, I have a post on avsim pmdg forum, 77 have viewed but no responces yet, but it has only been 1 full day...

Edited by Fltbuff7197

Share this post


Link to post
Share on other sites

THANK YOU so much, I figured it out with your guidance 

 

I took the base value for the event "set MCP IAS" add event value resulting on the below.

 

I played with several other settings and got them to work as well !!!!!!!!!!!!!!!!!!!!!!!!!!

 

ipc.control("84134", 327)

 

Still testing to make sure solution is consistent .

 

THANKS AGAIN !

Share this post


Link to post
Share on other sites
16 minutes ago, Fltbuff7197 said:

ipc.control("84134", 327)

Is that for increment or decrement?

Whilst providing the control number as a string does work, it is less efficient than giving the number directly, as it saves a step in the work the Lua interpreter has to do. In other words, just

ipc.control(84134, 327)

would be better.

Pete

 

 

Share this post


Link to post
Share on other sites

HI Pete

 

Thanks Again.

 

OK will try that.

 

Quick Question, I found 2 PMDG777 Offsets I would like to extract as a number value, but me the dummy is having issues.

 

6C34 4 FLT32 FMC_DistanceToTOD nm

0.0 if passed,

negative if n/a

6C38 4 FLT32 FMC_DistanceToDest nm

negative if n/a

If not too much trouble, could you show me the ipc.read... command I can use to get at this data?

I used ipc.readFLT(0x0634) but got weird number back  n.nnnnnnnnnnn e  ???????????? 

 

looking for the nnnnn of NM from TOD (FLT32 4 byte value ), also had Destination as an FLT32 4 byte value as well...

  

Share this post


Link to post
Share on other sites
2 hours ago, Fltbuff7197 said:

6C34 4 FLT32 FMC_DistanceToTOD nm

0.0 if passed,

negative if n/a

I used ipc.readFLT(0x0634)  

Did you mean to use ipc.readFLT(0x6C34) ?

Share this post


Link to post
Share on other sites

OK, got it !!!!!!!!!!!!!!

 

After re-reading several other posts, I re-traced my steps and redid what I thought I did in the first place and whalah!

 

set distance to dest airport= 2271.0102539063
set distance to dest airport= 2271.0041503906
set distance to dest airport= 2271.0012207031
set distance to dest airport= 2270.9956054688
set distance to dest airport= 2270.9899902344
set distance to dest airport= 2270.9821777344

 

I'm my .txt file I write out during script operations, I was able to see correct results for 0x6C38, distance to destination

 

distwork = ipc.readFLT(0x6C38)
 file:write("\nset distance to dest airport= " .. distwork)
  file:flush()

 

OH, and per FSUIPC documentation,  I made sure I had the PMDG777 OPTIONS.ini file entry below added BEFORE I started FSX:

[SDK]
EnableDataBroadcast=1

 

THANKS, issue now closed...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.