Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18
  1. #11
    75+ Posting Member
    Join Date
    Jan 2012
    Location
    Bexleyheath,Kent UK
    Posts
    102
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: FSBUS comm radio

    Quote Originally Posted by sasazevedo View Post
    Hello John.
    Have all system boards (with IO, DYSPLAYS and LEDS), and all boards work well, includingmanaged programming a MCP, which almost all working for the default aircraft, but would like to use at IFLY, but don't understand how to use the offsets it, as for example the offset9402 ", that takes a bit to every thing ...
    I'd like to understand how to do this in the program, for example:!

    MkFsObject(FS_AP_IAS, "",cbMcp,0x07E2,2,TP_UI16,FS_NORMAL,0);


    How to use the offset 9402 IFLY's in the example above?

    9402 0 DUCT_OVERHEAT_1_Light_Status
    9402 1 DUCT_OVERHEAT_2_Light_Status
    9402 2 DUAL_BLEED_Light_Status
    9402 3 RAM_DOOR_FUEL_DOOR_1_Light_Status
    9402 4 RAM_DOOR_FUEL_DOOR_2_Light_Status
    9402 5 PACK_TRIP_OFF_1_Light_Status
    9402 6 PACK_TRIP_OFF_2_Light_Status
    9402 7 WING_BODY_OVERHEAT_1_Light_Status


    I appreciate your attention and help.
    Don't be in a hurry!
    Ah ok

    Now my memory is bad so I am not sure the best way to explain without getting really into the swing of things again but if memory serves this is "bitwise operations"
    The state of the 8 bits held in the offset determine which lights are on/off...my description might be bad but this code works. clips from my CPP file

    So taking you example of 9402 .

    The remarked out (//) ones are entries ready for the correct CID/RID's where I have change my boards around

    at the top where you declare stuff

    // fwdoverhead.by John with masses of help from Ciccio

    #define ZERO 0x01
    #define ONE 0x02
    #define TWO 0x04
    #define THREE 0x08
    #define FOUR 0x10
    #define FIVE 0x20
    #define SIX 0x40
    #define SEVEN 0x80

    #include "stdafx.h"

    //Annunciators
    //Offset9402

    //MkFsbusObject (BTP_D_OUT, ANNUN_DUCT_OVEHEAT_1, "", EventHandlerFwdOverhead,X,XX,0); //CHANGE CID X AND XX CONNECTOR TO SUIT PANEL
    // MkFsbusObject (BTP_D_OUT, ANNUN_DUCT_OVEHEAT_2, "", EventHandlerFwdOverhead,X,XX,0); //CHANGE CID X AND XX CONNECTOR TO SUIT PANEL
    // MkFsbusObject (BTP_D_OUT, ANNUN_DUCT_OVEHEAT_2, "", EventHandlerFwdOverhead,X,XX,0); //CHANGE CID X AND XX CONNECTOR TO SUIT PANEL
    MkFsbusObject (BTP_D_OUT, ANNUN_RAM_DOOR_FUEL_DOOR_1, "", EventHandlerFwdOverhead,8,32,0);
    MkFsbusObject (BTP_D_OUT, ANNUN_RAM_DOOR_FUEL_DOOR_2, "", EventHandlerFwdOverhead,8,33,0);
    MkFsbusObject (BTP_D_OUT, ANNUN_PACK_TRIP_OFF_1, "", EventHandlerFwdOverhead,8,55,0);
    // MkFsbusObject (BTP_D_OUT, ANNUN_PACK_TRIP_OFF_2, "", EventHandlerFwdOverhead,X,XX,0); //CHANGE CID X AND XX CONNECTOR TO SUIT PANEL
    MkFsbusObject (BTP_D_OUT, ANNUN_WING_BODY_OHEAT_1, "", EventHandlerFwdOverhead,8,52,0);

    then further down the script the case statement to handle it


    case FS_9402_ANNUNS:
    // printf(" OFFSET 9402 READS ( %d )", Value);
    // if (Value & ZERO ){ FsbusWrite(ANNUN_DUCT_OVEHEAT_1, 1);} //next board
    // else if (Value | ZERO){FsbusWrite(ANNUN_DUCT_OVEHEAT_1, 0);} //next board

    // if (Value & ONE ){ FsbusWrite(ANNUN_DUCT_OVEHEAT_2, 1);} //next board
    // else if (Value | ONE){ FsbusWrite(ANNUN_DUCT_OVEHEAT_2, 0);} //next board

    // if (Value & TWO ){ FsbusWrite(ANNUN_DUAL_BLEED,, 1);} //next board
    // else if (Value | TWO){ FsbusWrite(ANNUN_DUAL_BLEED,, 0);} //next board

    if (Value & THREE){FsbusWrite(ANNUN_RAM_DOOR_FUEL_DOOR_1, 1);} //CID 8
    else if (Value | THREE){ FsbusWrite(ANNUN_RAM_DOOR_FUEL_DOOR_1, 0);} //CID 8

    if (Value & FOUR ){ FsbusWrite(ANNUN_RAM_DOOR_FUEL_DOOR_2, 1);} //CID 8
    else if (Value | FOUR){FsbusWrite(ANNUN_RAM_DOOR_FUEL_DOOR_2, 0);} //CID 8

    if (Value & FIVE ){ FsbusWrite(ANNUN_PACK_TRIP_OFF_1, 1);}
    else if (Value | FIVE){ FsbusWrite(ANNUN_PACK_TRIP_OFF_1, 0);}

    // if (Value & SIX ){ FsbusWrite(ANNUN_PACK_TRIP_OFF_2, 1);} //NEXT PCB
    // else if (Value | SIX){ FsbusWrite(ANNUN_PACK_TRIP_OFF_2, 0);} // NEXT PCB

    if (Value & SEVEN ){FsbusWrite(ANNUN_WING_BODY_OHEAT_1, 1);} //CID 8
    else if (Value | SEVEN){ FsbusWrite(ANNUN_WING_BODY_OHEAT_1, 0);} //CID 8


    As I say I am a year out of practice (long story) so I may not be describing this very well hope to be in the swing of things over the next few months or so. (sorry If I am worsening things...)
    Private me or contact me via the Ifly forum if you want any of my scripts.

    John
    Old, tired & broke (shouldn't be allowed out really)

  2. #12
    75+ Posting Member
    Join Date
    Jan 2012
    Location
    Bexleyheath,Kent UK
    Posts
    102
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: FSBUS comm radio

    Further to your post..
    The IAS (indicated air speed ) is the 'SPD' offset in ifly2fsuipc (offset 9436) the value held in that offset is the absolute value needed to show on the display and therefore there's no real relation to how we handle that like the bitwise stuff.

    PM me !

    John
    Old, tired & broke (shouldn't be allowed out really)

  3. #13
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Jan 2015
    Location
    Brasil
    Posts
    8
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: FSBUS comm radio

    John, you are being very helpful!
    His explanation cleared my mind to understand a more enfeebled bitwise treatment of theseoffsets, but ideally be able to see a full part of your program, so you can better understandthe entire string, and put into practice here.
    Unfortunately I do not have registration in Ifly Forum, but my email is sasazevedo@hotmail.com.
    Strong hug.
    Sergio.

  4. #14
    75+ Posting Member
    Join Date
    Jan 2012
    Location
    Bexleyheath,Kent UK
    Posts
    102
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: FSBUS comm radio

    Hi Sergio

    I will zip them up and send them to you.
    The only problem you might find is where I comment and remark things out ...This might not make much sense to you (my remarks don't even make sense to me now I revisit).
    Also a lot of stuff that works just fine will be remarked out I do this when testing/writing new sections.

    John
    Old, tired & broke (shouldn't be allowed out really)

  5. #15
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Jan 2015
    Location
    Brasil
    Posts
    8
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: FSBUS comm radio

    Hello again John.
    Once again I say that your help is being very helpful, and I appreciate your goodwill.
    The program that I made using the offsets default, was possible due to the examplesposted by Forum staff, and the good that, in addition to the fun, is the enrichment of learning being very good, because as I said, I'm not a professional programmer, I'm just anaviation lover with some knowledge in programming logic, which is trying to buildgradually his home cockpit.

    Hug.

    Sergio.

  6. #16
    75+ Posting Member
    Join Date
    Jan 2012
    Location
    Bexleyheath,Kent UK
    Posts
    102
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: FSBUS comm radio

    HI Sergio

    Your email is bouncing??? Private message me.

    John
    Old, tired & broke (shouldn't be allowed out really)

  7. #17
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Jan 2015
    Location
    Brasil
    Posts
    8
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: FSBUS comm radio

    John, eu não sei como enviar privado ...
    Give meyouremail I will answer!

  8. #18
    150+ Forum Groupie


    388TH_A's Avatar
    Join Date
    Nov 2008
    Location
    Medford, Oregon (USA)
    Posts
    238
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Thumbs up Re: FSBUS comm radio

    Quote Originally Posted by sasazevedo View Post
    John, eu não sei como enviar privado ...
    Give meyouremail I will answer!
    PM your email and I can give you a zip file of a c++ fsbus project that helped me learn, might answer alot of your questions

Page 2 of 2 FirstFirst 12

Tags for this Thread