Most of the commonly reported issues and questions are answered in the Frequently Asked Questions (FAQ) option under the Support menu of this website.
*** PLEASE NOTE ***
Your forum account is not the same as the account used in the shop. They are completely separate accounts.
1st December: A new version of the GoFlight Interface Tool for MSFS is now available.
12th November: A new version of the GoFlight Interface Tool for X-Plane is now available.
6th June: A new version of Virtual Flight Sim Hardware is now available (huge update)
21st November: A new version of the GoFlight Interface Tool for FSX/FSXSE/P3D is now available.

Setting Up the Q400

Slowly but surely am figuring things out in my attempts to set up the Q400. When I tackle a new switch I would like to know the best step by step approach to figuring it out.(Hopefully there is one)
By way of example, the ANIT-SKID switch. Here's what I did.
1) Searched the mouse clicks list that have been uncovered with no luck.
2) Spent some time testing some other mse clks with no luck. Still a lot left to check and some that appear to do nothing, but it is hard to tell.
3) Looked in the lvar.xsl for anything that looked like it might apply, no luck.
4) Ran Detective and found this when I clicked the switch on:
     GS_ANTISKID_SW    Lvar Data: 1
     Lvar : MJC_VAR_READ_CODE    Lvar Data: 9991999
5) Created a bespoke event  with  0 and 1 being on and off. The switch goes up and down between on and off.
6) Noticed while the switch moves nothing happens within the sim. When I click the switch in the sim the warning lights come on, on the panel and a tone sounds. When I use my bespoke the switch moves but no action.
7) So, I tried to incorporate the READ_CODE .... 9991999 using the 4 MJC_VAR_read/write/code/value. No luck.
8) Under events I found 66720 ANTISKID_BRAKES_TOGGLE. Not sure how to use this.

Am on on the right track as far as the step by step process goes? Where do I go from here?
Thanks,
Dave

Comments

  • Hi Dave,

    Anti-Skid is:
    ON

    MJC_VAR_WRITE_VALUE=1
    MJC_VAR_WRITE_CODE=96582

    Anti-Skid is:
    OFF

    MJC_VAR_WRITE_VALUE=0
    MJC_VAR_WRITE_CODE=96582

    Anti-Skid is:
    TEST

    MJC_VAR_WRITE_VALUE=2
    MJC_VAR_WRITE_CODE=96582

    Cheers, Rob
  • Thank robains. Appreciate this. Would love to know how you found the code 96582?
     
    Regards
    Dave
  • Just an FYI:

    Interface contains 2 special return codes, which are returned in the MJC_VAR_READ_CODE/MJC_VAR_WRITE_CODE:
    9991999 // Acknowledge success
    9992999 // Acknowledge variable not found

    What your seeing is the return code that the Q400 received a write to a variable ok. Look at the thread on the lights to see how to use it.
    Steve McNitt
  • One more tip too when you are converting those spreadsheet variables into a CRC, the spreadsheet has a ton of errors with commas being on the end of the variable that you need to remove or you get the wrong CRC value.
    Steve McNitt
  • Wow that does make a difference when taking out the comma's. Thanks Slayer.
    Have you ever had a look at the APU buttons?
    I am trying to figure them out. I have 4 push buttons on a P8 set up to turn on the APU power, starter, gen, and bleed air. Have them set up with the variables 1 for on and 0 for off with the appropriate codes, (without comma's :-)).
    Works to turn everything on, but I can't get the same button to then turn off the APU power, generator, or bleed air.
    Any tips on how to do this?
    Thanks
    Dave
  • With a single pushbutton you need to make an on and off in the same bespoke event so that it does a toggle , or make an event and send it a 1 for on and a separate event of zero for off then assign each separate event to the on and off states of the pushbutton

    here's how I do a toggle:

    :ON:     <--- this is a label
    if var =1 then next else skip
    var = 0
    :OFF:  <---  another label
    if var = 0 then next else skip
    var = 1


    all this does is a flipflop so if its a 1 it switches to a 0 and vice versa Or you need to do the other method mentioned above,

    some aircraft programmers have their stuff setup so you only need to send it a 1 each time but some don't , you just have to experiment, there's several ways you can make it do what you want,.

    Another method is a mouse event and that is the easiest way  IF you know which one to send with a left or right click,.  here's the discovered ones I have on my list. so you would just send mouse event 158 with a left click and thats it

    158OhdPanelAPU Power
    159OhdPanelAPU Startpush 2x just like in the VC
    160OhdPanelAPU generator
    Steve McNitt
  • Thanks Slayer! I will try and set up the push button toggle because I am interested in learning how to do it.
    I tried the APU push buttons with mouse clicks but I had the same issue. The first push of the  button would turn each of them on, but when I pushed the button again nothing would shut off. I will also try the mouse clicks again. Perhaps I set something incorrectly. So the input to use is leftmouseclick2x?

    Interesting that my mouse clicks are different???
    163     APU Power
    164     APU Start
    165     APU Get
    166     APU BAir

    Thanks again!
    Dave
  • The 2x just means you click it once, wait for the self test to finish then click it again to start the apu.

    Ill take a look at those switches when i get home and see what they need
    Steve McNitt
  • I find that I only have to click the POWER button once, the self test runs and then I push the start button. The APU starts and the GEN light appears so I can then turn it on and BAIR.

    I had also tried the separate bespoke for on and off and I couldn't get it to work either. Once again it would turn a button on, but when I pushed it again it would not shut it off. Tried different button actions and I couldn't get the correct combination. This was puzzling because It did work on the detective page when I pushed the test button for both on and off events. When I tried to set them up on the P8 I couldn't get the button to respond to off after it turned on.
    So I experimented with how you said you did a toggle. I had the same result. Would turn the button on, but not off in the detective test. Is this anywhere close to what is required?

    :on
    If MJC_VAR_WRITE_VALUE = 1 Next Else NextSkip
    MJC_VAR_WRITE_VALUE = 0
    MJC_VAR_WRITE_CODE = 53623
    :off
    If MJC_VAR_WRITE_VALUE = 0 Next Else NextSkip
    MJC_VAR_WRITE_VALUE = 1
    MJC_VAR_WRITE_CODE = 53623


    Contining to tinker with it....
    Dave
  • edited April 2016

    Hi Dave,

    You need to be careful with P8's because they are push buttons. When you press the button the "ON" event triggers and when you release the button the "OFF" event triggers. So both the "ON" and "OFF" Events will run after a single button press.

    Best wishes

    Steve

  • Hi Steve,
    I was wondering if the functionality of the buttons had anything to do with it, however when I try using the P8 or RP48 for things like the RECIRC fan and BLEEDS, one push turns them on and another push turns them off. That having been said I still can't get them to work for the APU buttons.... sigh!
    Haven't given up yet!
    Dave
  • Took me a while to see what I think happenens the but the majestic is weird, you can't read the mjc_var_write_value.

    Because first you tell it what to write, the the code to send it to.

    In your case you need to first read 53623, compare it with zero and1 like you are doing.

    The only change you need is to your first lines of on and off. I think its mjc_var_read_value 53623. But im not in front of a pc at the moment. Its in the sticky post on the mjc
    Steve McNitt
  • In detective search mjc_ actually that info is in the majestic download in the readme i think
    Steve McNitt
  • Also as the code reads, the :on tasks flow straight into the :off tasks. Make sure you have a  Goto :end or something after the :on block of tasks, otherwise you will be turning it on, then off.

    Best wishes

    Steve

  • edited May 2016
    brain fart....
    Steve McNitt
  • edited May 2016
    Dave try like this if it goes wrong don't blame me :P

    MJC_VAR_READ_CODE = 53623
    if MJC_VAR_READ_VALUE = 1 Next Else NextSkip
    MJC_VAR_WRITE_VALUE = 0
    if MJC_VAR_READ_VALUE = 0 Next Else NextSkip
    MJC_VAR_WRITE_VALUE = 1
    MJC_VAR_WRITE_CODE = 53623
    Steve McNitt
  • Thank you very much for your posts. Unfortunately I still haven't found success so I must be doing something wrong. This is what I came up with base on both of your posts. Is this close????

    :on
    MJC_VAR_READ_VALUE = 53623
    If MJC_VAR_WRITE_VALUE= 1 Next Else NextSkip
    MJC_VAR_WRITE_VALUE = 0
    MJC_VAR_WRITE_CODE = 53623
    Goto end
    :off
    MJC_VAR_READ_VALUE = 53623
    If MJC_VAR_WRITE_VALUE= 0 Next Else NextSkip
    MJC_VAR_WRITE_VALUE = 1
    MJC_VAR_WRITE_CODE = 53623
    :end

    Doesn't move the button in the sim on or off using the test button in GFIT.
    Thanks for your continuing help.
    Dave
  • Hi Slayer,
    Before I saw your last post I had spent the time creating what I did and posted it. When I tried your suggestion it does turn on the APU power (GFIT test button) but will not then turn it off.

    When I took your suggestion and altered my last attempt ( changing "If MJC_VAR_WRITE_VALUE= X Next Else NextSkip"  to "if MJC_VAR_READ_VALUE = X Next Else NextSkip") it turns on the power but does not turn it off.
    I can only think that I am doing something wrong with the way I set up the toggle and/or the way I set up Steve's suggestion with the Goto :end

    Thanks for the quick response.
    Dave
  • Ok I was trying to give you the shortcut answer but it doesn't work so we need to do the error checking and sleep to make this work. I've tested it so I know it works.

    :53623
    MJC_VAR_READ_CODE = 53623
    Sleep 150
    If MJC_VAR_READ_CODE != 9991999 Next Else NextSkip
    goto 53623
    :ONOFF
    if MJC_READ_VALUE = 0 Next Else NextSkip
    MJC_VAR_WRITE_VALUE = 1
    If MJC_VAR_WRITE_VALUE= 1 Next Else NextSkip
    MJC_VAR_WRITE_VALUE = 0
    :EXIT
    MJC_VAR_WRITE_CODE = 53623


    You only need to read  the code once and write it once at the end. The first part is like how I had to make the lights work, basically we request the info from the aircraft, wait for an acknowledge that it's ok to read the variable , then read it.

    This Power button is more like a switch because it's not a momentary pushbutton like your GF is.  Complicated I know.

    Most of the other buttons shouldn't take all this to get working....

    Steve McNitt
  • Hi Slayer,
    Well you did it! The event works on my P8. Love it! Will spur me on to work on the other 3. I am just a few buttons away from doing a mouse-free preflight and start-up!
    It still took a little tinkering to make it work and I am sure it was just a typo on your part. I will point it out just in case others are following along and will want to set this up.
    .....
    :ONOFF
    if MJC_READ_VALUE = 0 Next Else NextSkip ( should be if MJC_VAR_READ_VALUE....)
    MJC_VAR_WRITE_VALUE = 1
    If MJC_VAR_WRITE_VALUE= 1 Next Else NextSkip (should be IF MJC_VAR_READ_VALUE...)
    MJC_VAR_WRITE_VALUE = 0
    :EXIT
    MJC_VAR_WRITE_CODE = 53623

    I believe I have read through all the documentation in the manual and would never have been able to figure this out. Is there somewhere I can go to learn more about this programing?  Hate to be always bugging you for help!
    Thanks a million!
    Dave
  • Yeah my typing skills are not the best and autocorrect doesn't work on programming  :P

    Sorry about the typos, I didn't mean to make you lose anymore hair

    The additional stuff I put in is found in the file from majestic in the buttons and lights threads that are stickied, in that download there is a file named EXTXMLInterface.txt that explains reading and writing to the Q400.

    As far as the programming itself. I had been doing some BASIC since the 80's and took a year of C++ before I decided I didn't have the stamina for it.  Also done programming for HVAC control systems throughout the years so that helps a bit.

    When it's on my own pace and terms I do OK. On someone else's timeline , not so much. :)

    I thought about a tips and tricks thread on here maybe so we could share info as there are several ways oftentimes to end up with the same results. 

    A lot of the things with this program I figure out through experimentation using the "test" in detective  a LOT and then just chipping away at it. 


    Steve McNitt
  • Give a man a fish   feed em for a day, teach him to fish and feed him for a lifetime or so they say.
    Steve McNitt
  • Thanks Slayer will look that up and do some more reading.
    My programming experience comes from school in the 1970's when we had to take the punch cards to the computer room to have the program run by the teacher to see if you got it right!! :-)  A love/hate relationship with trying to figure this stuff out but I find it very interesting.
    I set the other 3 APU buttons.
    APU Start just required the mouse click 164.
    The APU Generator worked using your coding with the code 52698.
    The APU BleedAir worked using your coding as well with the code 57932. Interesting though, when in detective the test button would only start the BleedAir. I hooked it up to a P8 button anyway figuring I would work on it some more tomorrow and I was surprised to see it worked both on and off. You have to hold the button pushed for a few seconds for some reason to turn it off. Go figure.
    Only have a few free buttons and switches left on my GF equipment so might have to go shopping again soon to finish this off!
    Thanks for everything!!
    Dave
Sign In or Register to comment.