Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20
  1. #11
    500+ This must be a daytime job kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    698
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Rudder Trim Display in Airbus

    Hi Brian,
    Quote Originally Posted by brianwilliamson View Post
    I have then just put on its own to test:
    Var 2 Link IOCARD_OUT Device 1 Output 18 value 1

    But it will not light up.
    Are you sure about Device 1, should it not be Device 0?
    Nico
    Last edited by kiek; 04-23-2014 at 05:12 PM.

  2. #12
    300+ Forum Addict


    brianwilliamson's Avatar
    Join Date
    Oct 2005
    Location
    Gold Coast-AUSTRALIA
    Posts
    455
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Rudder Trim Display in Airbus

    Per-Erik, ok, you have done it again, works with that script. It has me a little dumbfounded as to how it knows to turn that led on with that text? The first one looks more logical.

    Also a big thanks to Nico. I tried the 0 but no change. Now you maybe correct in that, as I am using IOCards USB Expansion & Master card with one Display Card. But as I said I tried the 0 with no result.


    Not sure if there are any codes for having a 7 segment print a R or L.


    I will play around a bit more with the timing on the read write of the digits, as I suspect I am getting a little jitters on the 1st digit, due to a lag in read and write, but no big problem.(t does not do that with buttons on SIOC)


    Will have a crack at writing a script for the Audio panel on the A321 next week, so I more than likely have a few more questions.


    Again many thanks to both of you....................Brian W.

  3. #13
    500+ This must be a daytime job kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    698
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Rudder Trim Display in Airbus

    Hi Brian,
    Quote Originally Posted by brianwilliamson View Post
    Also a big thanks to Nico. I tried the 0 but no change. Now you maybe correct in that, as I am using IOCards USB Expansion & Master card with one Display Card. But as I said I tried the 0 with no result.
    It is not related to the number of Master Cards, but to how you have 'coded' your USB Expansion Card in the MASTER statement of your sioc.ini file. It should be the same as the first number after the equal_sign. Read more about it here.

    In Per-Erik's script also Device 0 is used (while if you are not using the DEVICE attribute, 0 is assumed).

    Regards,
    Nico
    Last edited by kiek; 04-23-2014 at 05:14 PM.

  4. #14
    150+ Forum Groupie


    Perik's Avatar
    Join Date
    Aug 2007
    Location
    NORWAY
    Posts
    193
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Rudder Trim Display in Airbus

    Hi Brian

    It has me a little dumbfounded as to how it knows to turn that led on with that text?
    It’s not too difficult. If you again look at Nico’s bible here:
    http://www.lekseecon.nl/howto.html#init
    and read this and the following chapter about “Flow of Control at startup”, I think you may get it
    It’s all about going from an unknown value to a known (0 in this case). This transition will
    execute the code inside the bracket. It’s more code than necessary as it gives you the option to
    start thinking of Cold&Dark.

    Not sure if there are any codes for having a 7 segment print a R or L.
    Are you able to program your own PIC16F876?
    If, then I can make a new Hex-code for your DisplayII board giving you the option
    to output L and R. The “R” letter will not be perfect though as it will be an “8” with the missing
    bottom segment. As an alternative to new firmware you could use 6 outputs from your Mastercard wired to
    the 7-segment in the same way as DP and then code in SIOC the correct segments according to “L” and “R”.

    I will play around a bit more with the timing on the read write of the digits, as I suspect I am getting a little jitters on the 1st digit, due to a lag in read and write, but no big problem.(t does not do that with buttons on SIOC)
    Do you have a RudderTrim gauge running in your FSX panel ?
    Regards,
    Per-Erik
    www.hoddo.net

  5. #15
    300+ Forum Addict


    brianwilliamson's Avatar
    Join Date
    Oct 2005
    Location
    Gold Coast-AUSTRALIA
    Posts
    455
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Rudder Trim Display in Airbus


    Thanks Nico and Per-Erik, now have combined the lot and working 100 percent.
    Will do some more study on Nico's site.

    I had some gear to program PICs but have not used it in a long while. Will leave that at the moment and get the Audio panel going.

    Per-Erik, yes I have the gauge running perfectly in the FSX airbus, so it has all worked out well.



    Look forward to some more advice as I am sure I will find some problems to solve.


    Cheers................Brian W.

  6. #16
    300+ Forum Addict


    brianwilliamson's Avatar
    Join Date
    Oct 2005
    Location
    Gold Coast-AUSTRALIA
    Posts
    455
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Rudder Trim Display in Airbus

    I am having difficulty linking the second part of the equation. As in:
    Var 0 Link IOCARD_SW Input 4 Type P
    {
    IF v1 = 0
    {
    v1 = 1
    }
    ELSE
    {
    v1 = 0
    }
    }

    Var 1 Link IOCARD_OUT Device 0 Output 11 // led

    This part Var 4 name XXXX Link FSUIPC_IN offset XXXX length y) for which I changed to:


    Var 1 Link FSUIPC_IN Offset 3105 Length 1 // Set VOR1 SOUND

    as the next line to get the switch to turn on and off the VOR1 Sound. Now I can see I think that there is no way it will rcognise that last statement.

    So my question is how do I get a switch to turn on both a led ( which I have OK ) and the sound of the Morse code on the VOR1. There are 2 FSUIPC codes that I see, 3105 or 3122.

    I have been studying the Flow control at startup on www.lekseecon., but do not seem to be able to quite get it .


    At least I have half working. Not sure how I will string 8 of the same thing together !!



    Cheers...........Brian W.

  7. #17
    500+ This must be a daytime job kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    698
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Rudder Trim Display in Airbus

    Quote Originally Posted by brianwilliamson View Post
    Var 0 Link IOCARD_SW Input 4 Type P
    {
    IF v1 = 0
    {
    v1 = 1
    }
    ELSE
    {
    v1 = 0
    }
    }
    Var 1 Link IOCARD_OUT Device 0 Output 11 // led
    You should not link (anything) to Var 0.
    Use another var number (say 100), and then write
    IF V100 = 0

    rgrds,
    Nico
    Last edited by kiek; 04-26-2014 at 05:40 AM.

  8. #18
    150+ Forum Groupie


    Perik's Avatar
    Join Date
    Aug 2007
    Location
    NORWAY
    Posts
    193
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Rudder Trim Display in Airbus

    Hi Brian

    Me again…..

    Here is a short script to turn on and off the VOR1 beacon sound.
    It seems that A321 don’t read 3105 but rather 3122.
    Use FSInterrogate to smoke out what is actually going on…..

    Code:
    //****************************************************************************
    // Taken from Pete's Offset list:
    // 3122 1 Radio audio switches. Read/write bit settings as follows:
    // 2^7 COM1 transmit
    // 2^6 COM2 transmit
    // 2^5 COM receive both
    // 2^4 NAV1 sound
    // 2^3 NAV2 sound
    // 2^2 Marker sound
    // 2^1 DME sound
    // 2^0 ADF1 sound
    // 
     
    Var 1 name NAV1_SOUND Link FSUIPC_INOUT Offset $3122 Length 1
    
    
    Var 2 name NAV1_SOUND_SW Link IOCARD_SW Input 38 type P
    {
          &NAV1_SOUND = CHANGEBIT 4 &NAV1_SOUND_SW   // Set bit 4 according to switch (0 or 1)
    }
    I’m a little bit confused as to how the A321 ACP works – could be a simplified simulation in FSX A321.
    I thought the CALL bottom in the panel should be the MIC selector and not for beacon activation.
    I’m used to B767 and there this function seems to a part of the Volume control.
    BTW – which A320 aircraft do you use – default FSX or something else?
    Another issue you’ll soon get into is synchronization between your hardware and Sim internals.
    We running Level-D B767 are lucky as Nico’s Lekseecon takes care of all the “backoffice” stuff
    I can start the rig from a saved flight at FL350 and everything is synchronized.


    Now one step back to your RudderTrim and jitter.

    As long as you have both your own hardware and the RudderTrim gauge active inside simulator,
    you’ll get a race between the those two “writers” as they are not in sync.
    When you write to the Offset, the gauge will get the new value and during its transition
    from old to new it will update the RudderTrim offset value as well.
    These intermediate values will make a lot of “noise” in your SIOC code and the jitters are the result.

    To get rid of the noise you need to write at a lower speed than the gauge do or filter out
    the change in gauge value completely until its equal to the value set from your SIOC script.

    The best would be to get rid of the gauge completely but not sure if that’s possible in your setup.
    The Rudder Trim gauge may be a part for a bigger and system depended gauge.

    Here is an update of the code to fix the jitter while using the default A321.
    Certainly other solutions out there as well but it seems to work.

    Code:
    //****************************************************************************
    // $0C04 Rudder trim value/control: –16383 to +16383
    // 16383/X=200, Xmax=81,915, OK so divide by 82 we should be safe.
    // I think displayed number will run from -199 to 199.
     
    Var 1 name TRIM_RAW Link FSUIPC_INOUT Offset $0C04 Length 2 Type 1  // RUDDER TRIM VALUE to/from FSUIPC
     
    //
    // To get rid of intermidiate values from FSX trim gauge.
    // We just skip those until the FSX gauge has catched up
    // with our value set by SIOC.
    // A consequence is that we can not set the trim by the gauge.
    //
    {
    IF &TRIM_RAW = &TRIM_VALUE      // Test if current trim value is equal to final value
                                    // If not, do nothing.
        {
        L0 = ABS &TRIM_RAW          // Get the absolute value
     
        IF &TRIM_RAW < 0            // Check if negative - display (L)eft else display (R)ight
            {
            &D_TRIMSIGN = -999998   // I set minus sign in the fourth display just to verify.
            }
        ELSE                        
            {
            &D_TRIMSIGN = -999999   // Else blank the sign position
            }
     
    // Now start to process the trim-value which is stored in L0
     
        L0 = DIV L0 82              // Now we have max 199 in L0
        L1 = MOD L0 10              // Grab right digit (D_TRIM0)
        &D_TRIM0 = L1               // and write to display 0 ( the decimal number)
     
        L1 = DIV L0 10              // Grab the middle digit (D_TRIM1) 
        &D_TRIM1 = MOD L1 10        
     
        L1 = DIV L0 100             // Last get the hundreds
        IF L1 = 0                   // Blank if less than 100 or 10.0 in display
            {
            L1 = -999999 // blank
            }
        &D_TRIM2 = L1               // Write the most significant 7-segment.
        }
    }
    //******************************************************************************* 
    Var 10 name D_TRIM0 Link IOCARD_DISPLAY Device 0 Digit 0 Numbers 1  // decimal digit
    Var 11 name D_TRIM1 Link IOCARD_DISPLAY Device 0 Digit 1 Numbers 1  // next - should also have DP set
    Var 12 name D_TRIM2 Link IOCARD_DISPLAY Device 0 Digit 2 Numbers 1  
    Var 13 name D_TRIMSIGN Link IOCARD_DISPLAY Device 0 Digit 3 Numbers 1   // Sign 
     
     
    //*******************************************************************************
    // Switches for:
    // 1. Reset Rudder Trim
    // 2. Left and right Rudder Trim 
    // As long as either Left or right toggle switches ( OFF - (ON) ) is pushed
    // the according rudder displacement is adjusted with a rate of 0,1 (Max deflection is 20) pr. 0,2 second.
    // The rate can easily be modified by the timer values.
    //
     
    // Reset Rudder
    Var 20 name RUDDER_RESET Link IOCARD_SW Input 38 type P //
    {
    &TRIM_VALUE = 0             // Set new value to zero
    &TRIM_RAW = &TRIM_VALUE     // and send to FSUIPC
    } 
     
    //
    // Left Rudder Trim (decrease rudder trim value)
    //
     
    Var 21 name RUDDER_LEFT Link IOCARD_SW Input 43 Type I
    {
    IF &RUDDER_LEFT = 1
        {
        &TIMER_RUDDER_L = 0                 // Set timer to 0 (startvalue)
        &TIMER_RUDDER_L = TIMER 1000 1 20   // Trigger at each 0,2s and continue 
        }
    ELSE
        {
        &TIMER_RUDDER_L = 999               // Stop timer asap
        }
    }
     
    Var 30 name TIMER_RUDDER_L
    {
    &TRIM_VALUE = &TRIM_VALUE - 82          // Decrease by some number
    &TRIM_RAW = &TRIM_VALUE                 // Store the new value and send to FSUIPC
    }
     
    //
    // Right Rudder Trim (increase rudder trim value)
    //
     
    Var 22 name RUDDER_RIGHT Link IOCARD_SW Input 62 Type I
    {
    IF &RUDDER_RIGHT = 1
        {
        &TIMER_RUDDER_R = 0
        &TIMER_RUDDER_R = TIMER 1000 1 20   // 0,2 second interval from 0 to 1000
        }
    ELSE
        {
        &TIMER_RUDDER_R = 999           // Stop timer asap
        }
    }
     
    Var 31 name TIMER_RUDDER_R
    {
    &TRIM_VALUE = &TRIM_VALUE + 82      // Increase value
    &TRIM_RAW = &TRIM_VALUE               // Store and update FSUIPC
    }
     
    Var 32 name TRIM_VALUE  value 0     // Storage for Trim value set from hardware
    Regards,
    Per-Erik
    www.hoddo.net

  9. #19
    300+ Forum Addict


    brianwilliamson's Avatar
    Join Date
    Oct 2005
    Location
    Gold Coast-AUSTRALIA
    Posts
    455
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Rudder Trim Display in Airbus

    Once again a big thanks to both Nico and Per-Erik.

    All works well now. The audio channels just turn the audio on or off for the Morse ID's and the 2 COMs are a bit different in that I have to turn com1 off before I turn on com2 and visa versa.
    So basically it is as it should be.


    Have not tried fixing the timing one yet but will do that tomorrow.


    The great part about the program is that once you get one going it is easy to do the rest and even better when it combines everything. Great !!



    Regards...................Brain W.

  10. #20
    300+ Forum Addict


    brianwilliamson's Avatar
    Join Date
    Oct 2005
    Location
    Gold Coast-AUSTRALIA
    Posts
    455
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Rudder Trim Display in Airbus

    Just been in the Sim doing the final testing and I am pleased to tell you that it all works perfectly with Jeehell's A320.

    Thanks to both Nico and Per-Erik for helping me out with the software learning etc., as I would have been struggling on my own to understand some of it in a short space of time.


    Regards...................Brian W.

Page 2 of 2 FirstFirst 12