Jump to content
The simFlight Network Forums

Steve38

Members
  • Posts

    81
  • Joined

  • Last visited

Posts posted by Steve38

  1. Hi Paul,

    Pete provides an LUA logging script - its in the the "Example LUA Plugins.zip file" which sits in the LUA_Plugins.zip file which you can download from this forum. The script you need is "log lvars.lua". Run this by assigning it to a button and a window will appear that displays all the LUA variables. I also enable LUA logging in FSUIPC and have the console displayed.

    By recording what variables and commands are sent via these two windows you can work out what the variables are. You will need to write some code to update things, as you don't write to the actual variable. E.g. read the altitude and then send x number of ipc.control commands to update the altitude in the sim. You can then write the altitide to the goflight display.

    Hope that helps.

    Best wishes

    Steve

  2. Hi Pete,

    I'm using FSX with Acceleration. The devices are all connected to one PC. I do use WideFS but not for any Goflight stuff.

    I don't know about the difference between a 166 and 166A. I do have a TQ6, how could I have forgot that :lol:

    I've just completed my LUA script using GFDisplay - it provides full autopilot support for PMDG J41. Before I offer it to the rest of the community, I'll modify it using your new facilities - it should provide a useful beta test.

    Yes, you do have my email address.

    Best wishes

    Steve

  3. Hi Pete,

    You've cracked it - works a treat! Many thanks for doing this :D

    This is the config file I used which is based on the MCP section included with GFDisplay. You may want to include it in the update.

    [GFMCPPRO.0]

    Needs=V16 B E A

    B=10 ; No too bright?

    D0.1=C5 XC4E U16 D30 ;NAV1 CRS as nnn

    D0.2=!C5 "360"

    D1.1=C0 C48 "" ; PM blank Spd

    D1.2=C0 !C48 C1 X4E8 U16 /100 D02 ; PM's Mach as (n).nn

    D1.3=C0 !C48 !C1 X4E0 U16 D30 ; PM's IAS as nnn

    D1.4=!C0 C46 X7E8 U32 /65536 D02 ; FS's Mach as (n).nn

    D1.5=!C0 !C46 X7E2 U16 D30 ; FS's IAS as nnn

    D2.1=C0 C6 X4E2 U16 D30 ; PM's HDG as nnn

    D2.2=C0 !C6 "360"

    D2.3=!C0 C7 X7CC U16 *360 /65536 D30 ;FS's HDG as nnn

    D2.4=!C0 !C7 "360"

    D3.1=C0 X4E4 S16 *100 D-50 ; PMs Alt as (-)nnnnn

    D3.2=!C0 X7D4 S32 *3.28084 /65536 D50 ; FSs Alt

    D4.1=C0 C47 "" ; PM blank VS

    D4.2=C0 !C47 X4E6 S16 *100 D-40 ; PM's V/S as (-)nnnn

    D4.3=!C0 X7F2 S16 D-40; FS's V/S as (-)nnnn

    D5.1=C5 XC4E U16 D30 ;NAV1 CRS as nnn

    D5.2=!C5 "360"

    L2.1=C0 X4F0 U16 M0001 ; PMs AP Master 1

    L2.2=!C0 X7BC U32 ; FS's ap eng CMD A

    L3.1=C0 X4F0 U16 M0001 ; PMs AP Master 1

    L3.2=!C0 X7BC U32 ; FS's ap eng CMD B

    L4.1=!C0 X810 U32 ; FS's Auto Throttle Active

    L7.1=C0 X4F0 U16 M0020 ; PMs LOC -> NAV light

    L7.2=!C0 C8 X7C4 U32 ; FS's NAV acquired

    L7.3=!C0 !C8 X7C4 U32 Fslow ; FS's NAV (flash)

    L14.1=!C0 X2EE0 U32 ; FS's Flight Director Active

    L16.1=C0 X4F0 U16 M0200 ; PMs Speed

    L16.2=!C0 !C2 X7DC U32 ; FS's IAS -> SPD

    L16.3=!C0 X7E4 U32 ; FS's Mach -> SPD

    L18.1=C0 X4F0 U16 M0080 ; PMs HDG

    L18.2=!C0 X7C8 U32 ; FS's HDG

    L19.1=C0 X4F0 U16 M0010 ; PMs APP

    L19.2=!C0 C4 X800 U32 ; FS's APP LOCKED

    L19.3=!C0 !C4 X800 U32 Fslow ; FS's APP Pending (flash)

    L20.1=C0 X4F0 U16 M0008 ; PMs ALT

    L20.2=!C0 X7D0 U32 ; FS's ALT

    L23.1=!C0 X2EE0 U32 ; FS's Flight Director Active

  4. This is the config that's working with the fudges on IAS, Altitude and VS

    [GFMCPPRO.0]

    Needs=V16 B E A

    B=10 ; No too bright?

    D0.1=C5 XC4E U16 D30 ;NAV1 CRS as nnn

    D0.2=!C5 "360"

    D1.1=C0 C48 "" ; PM blank Spd

    D1.2=C0 !C48 C1 X4E8 U16 /100 D02 ; PM's Mach as (n).nn

    D1.3=C0 !C48 !C1 X4E0 U16 D30 ; PM's IAS as nnn

    D1.4=!C0 C46 X7E8 U32 /65536 D02 ; FS's Mach as (n).nn

    D1.5=!C0 !C46 X7E2 *10 U16 D30 ; FS's IAS as nnn

    D2.1=C0 C6 X4E2 U16 D30 ; PM's HDG as nnn

    D2.2=C0 !C6 "360"

    D2.3=!C0 C7 X7CC U16 *360 /65536 D30 ;FS's HDG as nnn

    D2.4=!C0 !C7 "360"

    D3.1=C0 X4E4 S16 *100 D-50 ; PMs Alt as (-)nnnnn

    D3.2=!C0 X7D4 S32 *3.28084 /65536 D41 ; FSs Alt as (-)nnnnn

    D4.1=C0 C47 "" ; PM blank VS

    D4.2=C0 !C47 X4E6 S16 *100 D-40 ; PM's V/S as (-)nnnn

    D4.3=!C0 X7F2 S16 *10 D-40; FS's V/S as (-)nnnn

    D5.1=C5 XC4E U16 D30 ;NAV1 CRS as nnn

    D5.2=!C5 "360"

    L2.1=C0 X4F0 U16 M0001 ; PMs AP Master 1

    L2.2=!C0 X7BC U32 ; FS's ap eng

    L3.1=C0 X4F0 U16 M0001 ; PMs AP Master 1

    L3.2=!C0 X7BC U32 ; FS's ap eng

    L4.1=!C0 X810 U32 ; FS's Auto Throttle Active

    L7.1=C0 X4F0 U16 M0020 ; PMs LOC -> NAV light

    L7.2=!C0 C8 X7C4 U32 ; FS's NAV acquired

    L7.3=!C0 !C8 X7C4 U32 Fslow ; FS's NAV (flash)

    L14.1=!C0 X2EE0 U32 ; FS's Flight Director Active

    L16.1=C0 X4F0 U16 M0200 ; PMs Speed

    L16.2=!C0 !C2 X7DC U32 ; FS's IAS -> SPD

    L16.3=!C0 X7E4 U32 ; FS's Mach -> SPD

    L18.1=C0 X4F0 U16 M0080 ; PMs HDG

    L18.2=!C0 X7C8 U32 ; FS's HDG

    L19.1=C0 X4F0 U16 M0010 ; PMs APP

    L19.2=!C0 C4 X800 U32 ; FS's APP LOCKED

    L19.3=!C0 !C4 X800 U32 Fslow ; FS's APP Pending (flash)

    L20.1=C0 X4F0 U16 M0008 ; PMs ALT

    L20.2=!C0 X7D0 U32 ; FS's ALT

    L23.1=!C0 X2EE0 U32 ; FS's Flight Director Active

  5. Sorry pete, the 9's do display correctly now as well. I hadn't realised you had changed that so didn't check.

    The division by 10 is still present. I have found a work around by using the D parameters fractional part. E.g.

    A VS of -9900:

    D-50 = -0990

    D50 or D5 = 0990

    D40 or D4 = 990

    D-41 = -9900. (the last "0." represents the 1 digit fractional part and yes the "." does display. Its a work around I guess)

    Thanks

    Steve

  6. Hi Pete,

    The GF data bridge displays nine's OK in all displays.

    I have just replaced the GFDev.dll file in the modules directory with your version and it didn't change anything. Note I made sure the data bridge did not autoload so no other GFDev could have loaded. I run GFdisplay from the modules directory.

    Regarding number 2. Yes that was a typo by me it should have read -8800 and yes it is to do with the number 9 not displaying correctly.

    Regarding number 3. I had already tried that, but have double checked and it makes no difference. The sign is dropped, but only 4 digits display and its divided by 10.

    Best wishes

    Steve

  7. Hi Pete,

    I have just tested the VS with the GF Data Bridge and it display upto +/- 9900. The VS has 5 digits. Using GF display -700 is shown as -070 and an altitude of 3000 is shown as 0300. The GF Data Bridge would show them -0700 and 03000 respectively.

    Just doubled checked light 23 and it won't turn on so if you can connect it that would be great.

    I have just simplified the config so only the lights for just the FD and AP are monitored. If the FD is turned off or on the AP light goes out even though FS-Interrogate and the sim shows it as on. Same with the FD. The lights are cancelled when another is turned on.

    The Altitude has 5 digits as does the speed and VS.

    Thanks

    Steve

  8. Hi Pete,

    Progress so far:

    1) The MCP Pro is recognised and a GF connections entry is added.

    2) Displays are mapped as follows:

    0 = Left Hand COURSE

    1 = IAS/MACH

    2 = HEADING

    3 = ALTITUDE

    4 = VERT SPEED

    5 = Right Hand COURSE

    3) Lights are mapped as follows:

    0 = VNAV

    1 = LNAV

    2 = CMD A

    3 = CMD B

    4 = A/T Arm

    7 = VOR LOC

    9 = CWS A

    10 = CWS B

    14 = Flight Director Left

    15 = N1

    16 = SPEED

    17 = LVL CHG

    18 = HDG SEL

    19 = APP

    20 = ALT HOLD

    21 = V/S

    4) Problems with the displays:

    -V/S shows divided by 10 and go's to zero at -8900 or lower and at 8800 or higher

    -Altitude shows divided by 10

    5) Problems with the lights:

    - Cannot find the light value to light the right hand Flight Director light. Have tested for faulty LED and its fine. Have tested upto light value L130 and I still cannot find it - any advice?

    - Only the last light stays on. They all work, but when a new light gets displayed, the previous ones lit go's out. For example with the AP and FD on in the sim I start GFDisplay and the lights are on OK. Hit any of the AP buttons e.g. APP and the lights go out. Turn off and on the FD and then the APP light will go out. It seems to be only able to sustain one light command at a time.

    6) Here is the config I've been using:

    [GFMCPPRO.0]

    Needs=V16 B E A

    B=4 ; No too bright?

    D0.1=C5 XC4E U16 D30 ;NAV1 CRS as nnn

    D0.2=!C5 "360"

    D1.1=C0 C47 "" ; PM blank VS

    D1.2=C0 !C47 X4E6 S16 *100 D-40 ; PM's V/S as (-)nnnn

    D1.3=!C0 X7F2 S16 D-40 ; FS's V/S as (-)nnnn

    D2.1=C0 C6 X4E2 U16 D30 ; PM's HDG as nnn

    D2.2=C0 !C6 "360"

    D2.3=!C0 C7 X7CC U16 *360 /65536 D30 ;FS's HDG as nnn

    D2.4=!C0 !C7 "360"

    D3.1=C0 X4E4 S16 *100 D-50 ; PMs Alt as (-)nnnnn

    D3.2=!C0 X7D4 S32 *3.28084 /65536 D-50 ; FSs Alt as (-)nnnnn

    D4.1=C0 C47 "" ; PM blank VS

    D4.2=C0 !C47 X4E6 S16 *100 D-40 ; PM's V/S as (-)nnnn

    D4.3=!C0 X7F2 S16 D-40; FS's V/S as (-)nnnn

    D5.1=C5 XC4E U16 D30 ;NAV1 CRS as nnn

    D5.2=!C5 "360"

    L2.1=C0 X4F0 U16 M0001 ; PMs AP Master 1

    L2.2=!C0 X7BC U32 ; FS's ap eng

    L3.1=C0 X4F0 U16 M0001 ; PMs AP Master 1

    L3.2=!C0 X7BC U32 ; FS's ap eng

    L4.1=!C0 X810 U32 ; FS's Auto Throttle Active

    L7.1=C0 X4F0 U16 M0020 ; PMs LOC -> NAV light

    L7.2=!C0 C8 X7C4 U32 ; FS's NAV acquired

    L7.3=!C0 !C8 X7C4 U32 Fslow ; FS's NAV (flash)

    L14.1=!C0 X2EE0 U32 ; FS's Flight Director Active

    L16.1=C0 X4F0 U16 M0200 ; PMs Speed

    L16.2=!C0 !C2 X7DC U32 ; FS's IAS -> SPD

    L16.3=!C0 X7E4 U32 ; FS's Mach -> SPD

    L18.1=C0 X4F0 U16 M0080 ; PMs HDG

    L18.2=!C0 X7C8 U32 ; FS's HDG

    L19.1=C0 X4F0 U16 M0010 ; PMs APP

    L19.2=!C0 C4 X800 U32 ; FS's APP LOCKED

    L19.3=!C0 !C4 X800 U32 Fslow ; FS's APP Pending (flash)

    L20.1=C0 X4F0 U16 M0008 ; PMs ALT

    L20.2=!C0 X7D0 U32 ; FS's ALT

    Best wishes

    Steve

  9. Hi Pete,

    I enabled button logging and it shows continuous "FS Control Sent:" enteries which is my script detecting invalid button presses on the rotaries and sending the ipc.control commands.

    When I actually turn a rotary dial the stream of FS Control Sent's is interrupted with "Joystick Values" enteries so it is picking up the rotaries being moved.

    It does appear that LUA is seeing the rotaries as always on.

    If I change the value in my program for the MCP Pro rotaries joystick number for an invalid joystick the stream of "FS Control Sent:" enteries stop, so it is pointing to some oddity in seeing these rotary buttons as always active.

    I'm starting the program with a button at the moment, not from ipcReady.lua - is that a problem?

    Thanks

    Steve

  10. Hi Pete,

    I had assigned Go Flight MCP Pro dials (buttons in FSUIPC) to activate certain LUA scripts, however when the dial was rotated fast, activity seems to slow down e.g. the hdg did not turn as fast. I had assigned some code to accomdate the "fast" button on the rotary dial which did work, but I guessed the LUA scripts was being killed off each time the button was activated and thus the slow down in activity. I upgraded to the latest FSUIPC beta but this still seems to occur.

    Reading the beta release notes you recommend:

    "Note that, if a Lua plug-in is really intended to be used repetitively, it may be much more efficient to actually program it with a loop in the Lua code and have it checking the state of the relevant button or key itself."

    I have therefore done this:

    local function buttonpressed(joynum, btn)

    return ipc.testbutton(joynum, btn)

    end

    joynumdial = 157

    joynumbutt = 158

    bincaltslow = 10

    bincaltfast = 11

    bsynchdg = 12

    while 1 do

    if buttonpressed(joynumdial, bincaltslow) then

    -- Increase Alt slow

    rotateALTKnob("R", 0)

    changeALT(100)

    end

    if buttonpressed(joynumdial, bincaltfast) then

    rotateALTKnob("R", 1)

    changeALT(2500)

    end

    if buttonpressed(joynumbutt, bsynchdg) then

    SyncHDG()

    end

    sleep(100)

    end

    The first two "if" statements are MCP Pro rotary dials and turn continously whilst the third "if" statement works correctly. The program is much longer and tests all buttons and rotary dials. The buttons work fine, but the rotary dials are always "on" and thus the code for those always activates regardless of whether I'm turning the dial or not. Any ideas what is wrong?

    Thanks

    Steve

  11. Hi Pete,

    I'm having trouble using the ipcPARAM variable. I have assigned a button to run an LUA script and in the parameter field entered the number one.

    I have tried just reading it as param=ipcPARAM and also assigning it as param = ipc.get("ipcPARAM") in the script but without any success. I want to be able to test ipcPARAM to determine different actions in the script. e.g. if param == 1 then .......

    I'm clearly missing something, can you help please?

    Thanks

    Steve

×
×
  • 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.