Page 3 of 16 FirstFirst 123456713 ... LastLast
Results 21 to 30 of 158
  1. #21
    25+ Posting Member
    Join Date
    Nov 2013
    Location
    Blackburn UK
    Posts
    41
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: PMDG 737NGX and Link2fs Multi (Experts)

    Thanks Mike i think i understand where your going with the code ill have a good test when back at home (working nights at the mo grrr).
    I've been using the quadrature library that came with link2fs so will take a look at yours and see if i can get it doing the same. Basically you are reading the fsuipc offset then setting a variable, once your turn the encoder your changing the variable plus or mnus and re-uploading that as a serial print to Jims program for link2fs to do the clever stuff in the background

  2. #22
    25+ Posting Member
    Join Date
    Nov 2013
    Location
    Blackburn UK
    Posts
    41
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: PMDG 737NGX and Link2fs Multi (Experts)

    well i have the ALT now adjusting mike your a star!!

    next issue to resolve is getting it faster i think this is due to my encoder mine is a 1:1 encoder not a 1:4 so its taking 4 pulses to see 1 step if i understand the logic correctly

    with a little digging i found that the encoder needs to turn 4 clicks to alter the alt but only after a serial write to the card? it seems to be waiting for the read before updating.

  3. #23
    25+ Posting Member
    Join Date
    Nov 2013
    Location
    Blackburn UK
    Posts
    41
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: PMDG 737NGX and Link2fs Multi (Experts)

    so to answer everyone's questions is YES the altitude knob can be controlled via link2fs!

    Very happy bunny and could not have done it with Jims software and Mikes little snippets of code cheers to both of you!

    the only thing i needed to alter too was the Quadrature.cpp file and change the full encoder to half to work with the leo bodnars supplied encoders.

    here's a video of it working (test box in use)
    https://www.dropbox.com/s/w6rs4xd8wl...2015.04.31.mp4

    one thing i found was reading the serial then setting a variable the numbers would jump about so im no longer reading anything just uploading data this means that on first set-up you need to twist all the knobs to set the initial readings then its all synced.

    the speed works but not with mach yet that needs a little more work


    the code below updated to include speed, hdg, and course variables

    /*


    Program for homebuilt B738 MCP


    */
    #include "math.h"
    #include "Quadrature.h"


    Quadrature enalt(8,9); //ALT
    Quadrature enhdg(6,7); //HDG
    Quadrature enspd(4,5); //SPD
    Quadrature encrs(2,3); //CRS


    int CodeIn;// used on all serial reads
    int KpinNo;
    int Koutpin;


    String KoldpinStateSTR, KpinStateSTR, Kstringnewstate,Kstringoldstate;


    unsigned int mcpalt;// mcp altitude the unsigned give 0-65K and removes negitive numbers.
    int mcphdg;// mcp heading
    int mcpspd;// mcp speed
    int mcpcrs;// mcp course (captians)
    int mcpvs; // MCP vertical speed
    int altx; //encoder altitude move
    int altold; //encoder alt old position
    int altdif; //encoder alt direction check
    int hdgx; //encoder hdg move
    int hdgold; // encoder hdg old position
    int hdgdif; // encoder hdg direction check
    int crsx; // encoder course move
    int crsold; // encoder course old position
    int crsdif; // encoder course direction check
    int spdx; // encoder speed move
    int spdold; // encoder speed old position
    int spddif; // encoder speed direction check


    void setup()
    {
    Kstringoldstate = "111111111111111111111111111111111111111111111111111111111111111111111";

    for (int KoutPin = 10; KoutPin < 70; KoutPin++)// Get all the pins ready for "Keys"
    {
    pinMode(KoutPin, INPUT);
    digitalWrite(KoutPin, HIGH);
    }
    Serial.begin(115200); //start checking serial connection
    }


    void loop() {
    {INPUTS();} // inputs to pc loop


    if (Serial.available()) {// Check if serial data has arrived from PC
    CodeIn = getChar();
    if (CodeIn == '=') {EQUALS();} // The first identifier is "="
    if (CodeIn == '<') {LESSTHAN();}// The first identifier is "<"
    if (CodeIn == '?') {QUESTION();}// The first identifier is "?"
    if (CodeIn == '/') {SLASH();}// The first identifier is "/" (Annunciators)
    if (CodeIn == '#') {POUND();}// the pound identifier is "#" (simconnect inputs)
    }


    }
    char getChar()// Get a character from the serial buffer
    {
    while(Serial.available() == 0);// wait for data
    return((char)Serial.read()); //thanks doug
    }


    void EQUALS(){ // The first identifier was "="
    CodeIn = getChar(); // Get another character
    switch(CodeIn) {// Now lets find what to do with it
    case 'A'://Found the second identifier
    //Do something
    break;

    case 'B':
    //Do something
    break;

    case 'C':
    //Do something
    break;

    //etc etc etc
    }
    }


    void LESSTHAN(){ // The first identifier was "<"
    CodeIn = getChar(); // Get another character
    switch(CodeIn) {// Now lets find what to do with it
    case 'A'://Found the second identifier
    //Do something
    break;

    case 'B':
    //Do something
    break;

    case 'C':
    //Do something
    break;

    //etc etc etc
    }
    }


    void QUESTION(){ // The first identifier was "?"
    CodeIn = getChar(); // Get another character
    switch(CodeIn) {// Now lets find what to do with it
    case 'A'://Found the second identifier
    //Do something
    break;

    case 'B':
    //Do something
    break;

    case 'C':
    //Do something
    break;

    //etc etc etc
    }
    }
    void SLASH(){ // The first identifier was "/" (Annunciator)
    //Do something
    }


    void POUND() { //the first identifier was "#"
    CodeIn = getChar(); // Get another character
    switch(CodeIn) {// Now lets find what to do with it
    //do something to displays
    }
    }
    void INPUTS() {
    // altitude encoder reads in 100 increments Y03 simconnect input


    altx=(enalt.position()/1);
    if (altx != altold) { // checks to see if it different
    (altdif = (altx-altold));// finds out the difference


    if (altdif == 1) {
    mcpalt = mcpalt - 100;
    if (mcpalt > 50200) {mcpalt = 0;}
    Serial.print("Y03"); Serial.println(mcpalt);}
    if (altdif == -1) {
    mcpalt = mcpalt + 100;
    if (mcpalt > 50000) {mcpalt = 50000;}
    Serial.print("Y03"); Serial.println(mcpalt);}

    altold = altx; // overwrites the old reading with the new one.
    }

    // heading encoder
    hdgx=(enhdg.position()/1);
    if (hdgx != hdgold) {
    (hdgdif = (hdgx-hdgold));

    if (hdgdif == 1) {
    mcphdg = mcphdg - 1;
    if (mcphdg < 0) { mcphdg = 359; }
    Serial.print("Y02"); Serial.println(mcphdg);}
    if (hdgdif == -1) {
    mcphdg = mcphdg + 1;
    if (mcphdg > 359) { mcphdg = 0; }
    Serial.print("Y02"); Serial.println(mcphdg);}

    hdgold = hdgx;
    }

    // captians course encoder
    crsx=(encrs.position()/1);
    if (crsx != crsold) {
    (crsdif = (crsx-crsold));

    if (crsdif == 1) {
    mcpcrs = mcpcrs - 1;
    if (mcpcrs < 0) { mcpcrs = 359; }
    Serial.print("Y04"); Serial.println(mcpcrs);}
    if (crsdif == -1) {
    mcpcrs = mcpcrs + 1;
    if (mcpcrs > 359) { mcpcrs = 0; }
    Serial.print("Y04"); Serial.println(mcpcrs);}

    crsold = crsx;
    }

    // speed encoder
    spdx=(enspd.position()/1);
    if (spdx != spdold) {
    (spddif = (spdx-spdold));

    if (spddif == 1) {
    mcpspd = mcpspd - 1;
    if (mcpspd < 100) { mcpspd = 100; }
    Serial.print("Y01"); Serial.println(mcpspd);}
    if (spddif == -1) {
    mcpspd = mcpspd + 1;
    if (mcpspd > 340) { mcpspd = 340; }
    Serial.print("Y01"); Serial.println(mcpspd);}

    spdold = spdx;
    }


    }// end of inputs

  4. Likes xflight38, Mikeb1028 liked this post
  5. #24
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Apr 2014
    Location
    Budapest
    Posts
    6
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Link2fs Multi v6b delay with SimConnect Inputs (Experts)?

    Thanks for the link!
    Perhaps the only problem that I do not have FS9 FSX.
    The FS9 for me to solve?

    Quote Originally Posted by Fess_ter View Post
    I'm curious.

    Why are you using the FSUIPC section to get values for the MCP when the values are listed in the normal SimConnect Extractions(1) section?

    Also, why are you using the "Expert" section of SimConnect Inputs for rotary encoders when the already defined codes can be used from the "normal" SimConnect Inputs section? Example: "A55" and "A56", course down, course up.

    Does it have to do with an aircraft that doesn't use standard FSX autopilot SimConnect values?

    Show your code and maybe a pic of your display setup.

    I am currently working on an MCP myself and have it mostly coded and functional.
    I still need to finish the enclosure, and wire up a couple more buttons.

    ~Fess

  6. #25
    New Member
    Join Date
    Jun 2014
    Location
    Brasil
    Posts
    2
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: PMDG 737NGX and Link2fs Multi (Experts)

    Hello to all.


    I'm using the PMDG NGX as link2fs. But the experts tab SimConnect Extrations not know how to access the values ​​of variables of the PMDG NGX. I have the map offset from PMDG. Has come assist me?


    thank you

  7. #26
    New Member
    Join Date
    Jun 2014
    Location
    Brasil
    Posts
    2
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Link2fs Multi v6b delay with SimConnect Inputs (Experts)?

    Hello to all.


    I'm using the PMDG NGX as link2fs. But the experts tab SimConnect Extrations not know how to access the values ​​of variables of the PMDG NGX. I have the map offset from PMDG. Has come assist me?


    thank you

  8. #27
    75+ Posting Member
    Join Date
    Apr 2014
    Location
    Tampa, FL, USA, Earth..umm
    Posts
    77
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: PMDG 737NGX and Link2fs Multi (Experts)

    lourivalspires, the values I used are the ones in the PMDG SDK file: PMDG_NGX_SDK.h

    Look in that file for what you want to do, like:

    #define EVT_OH_LIGHTS_R_TURNOFF (THIRD_PARTY_EVENT_ID_MIN + 116)
    #define EVT_OH_LIGHTS_TAXI (THIRD_PARTY_EVENT_ID_MIN + 117)

    Let's say I want to mess with the Taxi Lights (EVT_OH_LIGHTS_TAXI). To the right it says "THIRD_PARTY_EVENT_ID_MIN + 117". What you want to do is get that value of THIRD_PARTY_EVENT_ID_MIN and add 117 to it. You enter that number beginning with a pound sign (#) in the Experts -> SimConnect section.

    What is THIRD_PARTY_EVENT_ID_MIN? There is a line in that file that has

    #define THIRD_PARTY_EVENT_ID_MIN 0x00011000 // equals to 69632

    So, you would add 69632 to whatever value you want to adjust, like for the taxi lights above, 69632 + 117 = 69749 In the SimConnect section you would put #69749 in the value for whatever variable you wanted to assign it to.

    For my NGX setup, I'm using 24 of the 25 SimConnect variable spaces.

    Mike

  9. Likes xflight38 liked this post
  10. #28
    500+ This must be a daytime job Jim NZ's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    767
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: PMDG 737NGX and Link2fs Multi (Experts)

    Hi Guys ,, I've been meaning to revisit this and get a couple of experiments done if some-one has the time.
    It's bought on by Guys wanting more inputs into the PMDG NGX and also at the moment I'm working on making an FS9 'Expert' version.

    It's my thought that every control input does not need a separate 'slot' in Simconnect or FSUIPC and it should work the same as FSUIPC where the offset gets registered once and the different 'controls' are activated via the '+' number ,, which is more or less like 'controls' in FSUIPC once the offset '3110' has been registered. (Thinking about that ,, I didn't try 'controls' without that offset '3110' being in there ,,, FSUIPC controls may still work without it being there ??)

    Background ,,
    I thought it 'unexpected' that the NGX worked thru Simconnect and not thru FSUIPC ,, I expected to be the other way around.
    (I don't have FSUIIPC or the PMDG NGX to play with)

    Now a couple of theories ,, for them I'll use the
    (EVT_OH_LIGHTS_TAXI) event as in the above post and it's number
    669632 + 117 = 69749
    Some controls need a number after them ie 1 for ON ,, 0 for OFF or maybe a complete setting 123 (if it were heading ??)
    Whether 69749 needs that extra digit or not,, I don't know,, some will.
    So now for the taxi lights we have ,,
    69749 or 697490 or 697491
    The preceding # is a mystery to me so in the below experiments ,, try it with the # and without it.
    Anyway ,, you get the picture.

    It is a 'must' that you make a new folder with a new 'Multi' and start 'fresh' with this experiment with no pre-saved parameters etc.
    Then you will need to start FSX and NOT start your present user 'multi' ,, just start the new unsaved multi.
    There is no need to have an Arduino attached as the "Send it to FSX" button goes thru the same code as input from the serial port.

    =======================

    Simconnect inputs ,,,,
    In the slot Y01 put ,, THIRD_PARTY_EVENT_ID_MIN
    Press the green reset button.
    In the "Send it to FSX" box put ,,,,
    Y0169749 or Y01697490 or Y01697491
    or add the # before them ,,,
    Y01#69749 or Y01#697490 or Y01#697491
    Y01#69749 or Y01#69749#0 or Y01#69749#1
    etc etc
    Does anything work ????

    =======================

    FSUIPC ,,,
    The offset 3110 seemed to be a gateway to simconnect (and other stuff) so that's only thing I can think of trying.
    If offset 3110 is in slot #g like it was when it first ran, then try ,,
    Press the reset button.
    In the "Send it to FSX" box put ,,,,
    #g69749 or #g697490 or #g697491
    or add the # before them ,,,
    #g#69749 or #g#697490 or #g#697491
    #g#69749 or #g#69749#0 or #g#69749#1
    etc etc
    Does anything work ????

    ======================

    The logic behind all this is to find an easier gateway into the NGX instead of having a swag of slots taken up for some things that will be used only occasionally.

    Mike, you may or may not have tried all this but I finally got my hands on the PMDG_NGX_SDK.h and some of it makes sense for my angle of attack but Tony (my local mate) hasn't got the NGX so I'm a bit lost.


    Cheers Guys ,,, Jim
    www.jimspage.co.nz/intro.htm
    All this and Liz still loves me ! !

  11. #29
    25+ Posting Member
    Join Date
    Jun 2014
    Location
    france
    Posts
    44
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Post Re: PMDG 737NGX and Link2fs Multi (Experts)

    Hello All ,

    Quote Originally Posted by Jim NZ View Post
    =======================
    Simconnect inputs ,,,,
    In the slot Y01 put ,, THIRD_PARTY_EVENT_ID_MIN
    Press the green reset button.
    In the "Send it to FSX" box put ,,,,
    Y0169749 or Y01697490 or Y01697491
    or add the # before them ,,,
    Y01#69749 or Y01#697490 or Y01#697491
    Y01#69749 or Y01#69749#0 or Y01#69749#1
    etc etc
    Does anything work ????
    =======================
    FSUIPC ,,,
    The offset 3110 seemed to be a gateway to simconnect (and other stuff) so that's only thing I can think of trying.
    If offset 3110 is in slot #g like it was when it first ran, then try ,,
    Press the reset button.
    In the "Send it to FSX" box put ,,,,
    #g69749 or #g697490 or #g697491
    or add the # before them ,,,
    #g#69749 or #g#697490 or #g#697491
    #g#69749 or #g#69749#0 or #g#69749#1
    etc etc
    Does anything work ????
    ======================
    Ive try both without succes here ...but its an interesting way Jim

    Quote Originally Posted by Jim NZ View Post
    Some controls need a number after them ie 1 for ON ,, 0 for OFF or maybe a complete setting 123 (if it were heading ??)
    Whether 69749 needs that extra digit or not,, I don't know,, some will.
    If I put in YO1 #69749 Then i must send YO11 in input testing or YO10 (on/off )

  12. #30
    150+ Forum Groupie
    Join Date
    Nov 2013
    Location
    Evansville, Indiana
    Posts
    251
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: PMDG 737NGX and Link2fs Multi (Experts)

    I tried too, Jim.
    No dice.

    It's kind of funny. I haven't done any work on my MCP since May.
    Last night I started back into it, and suddenly there is this flurry of activity on these boards.
    Must be something seasonal.

    I got jazzed up again when I extracted the PMDG MCP HDG from the FSUIPC in EXPERT and then coded it to change with the encoder thru the custom SimConnects.
    I haven't coded the acceleration yet, but I think I have the solution. I am not using any quadrature libraries.

    On a side note Jim, I think I see what you were saying with the experiment.

    Is it possible to have a solution where we could pass the SimConnect codes, proxy-like, straight from the arduino thru Link2FS without it being pre-defined in Link2FS.
    I don't understand the nuance of what is involved with interfacing SimConnect. I am still ignorant on that subject.
    Going to try and research it.


    ~Fess
    I will only ever be, half the Geek that I wished I was.
    TheGeekForge.Com

Page 3 of 16 FirstFirst 123456713 ... LastLast