Page 5 of 6 FirstFirst 123456 LastLast
Results 41 to 50 of 55
  1. #41
    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: Scaling Localiser and Glideslope Needles for HSI

    Hi Jack,
    Congratulations!

    For other readers wondering what did the 'trick':

    Some FSUIPC offsets contain as well negative as positive values, or in other words, they contain 'signed' values. Eg a byte can then hold values between -127 and + 127. While an 'unsigned' byte can hold values between 0 and 255.

    However a Variable in SIOC is by default treated by SIOC as 'unsigned'. If you want SIOC to treat a variable as signed you have to add the attribute Type 1.
    More here

    regards,
    Nico Kaan

  2. #42
    500+ This must be a daytime job



    Join Date
    Jul 2013
    Posts
    917
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Scaling Localiser and Glideslope Needles for HSI

    Jack

    Glad you got there in the end

    David

  3. #43
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Scaling Localiser and Glideslope Needles for HSI

    Hi everyone,

    I have just noticed a problem due to how FSX handles this offset.

    Whenever the GS needle is not on the scale, GS = 0, which means the needle is in the centre. Clearly, however, if the GS needle is not on the scale, it is not in the middle.

    I am wondering on what is the best way to tackel this issue.

    Jack

  4. #44
    500+ This must be a daytime job 737NUT's Avatar
    Join Date
    Feb 2006
    Location
    Indianapolis, IN
    Posts
    761
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Scaling Localiser and Glideslope Needles for HSI

    Isn't there an offset for GS Active? If so, when that active, center needle, when not, deflect off of scale.

    Rob

  5. #45
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Scaling Localiser and Glideslope Needles for HSI

    Hi Rob,

    I managed to fix it be implementing the GS Flag offset into the script. Even then though, I have to tell SIOC that if the needle is at 0, it's actually not (if you get that).

    We now have another problem. When attempting to compile the following script with another (group compile), I get an error:

    "ERROR: Line 19 "Var 0001"

    This is the script:

    Code:
    Var 0, Value 0
    {
     &Motor_1 = 120
     IF &Motor_1 = 120
     {
      &Motor_1 = 250
     }
    }
    
    Var 814 link FSUIPC_IN Length 1 Offset $023A   // seconds of FS time  (0 - 59)
    {
     IF &New_GS = 119
     {
      IF &GS_Flag = 0
      {
      &New_GS = 0
      }
     }
    }
    
    Var 0005, name GS_Flag, Link FSUIPC_IN, Offset $0C4C, Length 1,   // FSUIPC GS FLAG Source
    
    Var 0866, name GS, Link FSUIPC_IN, Offset $0C49, Length 1, Type 1     // FSUIPC GS Source
    {
     L0 = &GS + 119
     &New_GS = L0
    }
    
    Var 0097, name Potentiometer, Link SUBRUTINE
    {
     L0 = &Pot_Orig * -1
     L0 = L0 + 171
     &Pot = L0
     CALL &Value_Calc
    }
    
    Var 0001, name Motor_1, Link USB_DCMOTOR, Output 1     // Motor
    
    Var 0058, name Pot_Orig, Link USB_ANALOGIC, Input 2, PosL 0, PosC 127, PosR 250     // Potentiometer
    {
     CALL &Potentiometer
    }
    
    Var 9991, name New_GS
    
    Var 8754, name Pot
    
    Var 0003, name Value_Calc, Link SUBRUTINE     // Provides a scale between GS and Pot
    {
     L0 = &Pot * 3.260
     &Calc = L0
     CALL &Position
    }
    
    Var 0030, name Calc     // Calculation holding variable
    
    Var 0002, name Position, Link SUBRUTINE     // The Calculations for driving the motor
    {
      IF &Calc > &New_GS
     {
      &Motor_1 = 250
     }
      ELSE
      {
       IF &Calc < &New_GS
       {
        &Motor_1 = 120
       }
        ELSE
        {
         IF &Calc = &New_GS
         {
          &Motor_1 = 128
         }
        }
      }
    }
    AS you can see, there is nothing wrong with line 19 (it's the one that defines the FS time offset).

    I take it that the error is from SIOC renumbering all my vars in the group compile?

    The other file is clean, it has nothing to do with this error.

    Jack

  6. #46
    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: Scaling Localiser and Glideslope Needles for HSI

    Hi Jack,
    If you get a compile error it is most certainly caused by the last change you made. So try to remember what you have changed..

    From what you write it is the addition of the GS_Flag, maybe it is the extra comma after Lenght 1 ?

    regards,
    Nico
    Last edited by kiek; 06-15-2011 at 01:13 AM.

  7. #47
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Scaling Localiser and Glideslope Needles for HSI

    HI Nico,

    I removed the comma and still not luck.

    Interestingly, the two files compile seperately, but not together. This usually means a "var already exists" error, but as you can see, all the variables have different names. It is a "command outside place error".

    Jack

  8. #48
    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: Scaling Localiser and Glideslope Needles for HSI

    Jack,
    Export to one .TXT file and look at line 19... (after that, delete that .TXT file).
    Nico

  9. #49
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Scaling Localiser and Glideslope Needles for HSI

    Hi Nico,

    Do you mean merge the two files, or compile them together and teh nexport as txt?

    Jack

  10. #50
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Scaling Localiser and Glideslope Needles for HSI

    Hi Nico,as

    I'm still working on compiling both files together.

    Still no luck. SIOC is telling me that "0001" is causing the problem (note it is not me naming it 0001, but SIOC's group compiler that changes it to 0001).

    I don't see what the problem is. I have changed the variable numbers, triple-checked all brackets (though it's impossible to be a problem here as both files compile just fine seperately), and even tried changing the order of the scripts. Still no luck.

    It's getting quite frustrating now. Please, tell me, what does "0001" mean? And why is SIOC telling me that this number is the problem?

    These are the EXACT two files that I'm using; seperately they compile fine. I'll even put the order in which they're compiled in the config.ini file.

    File 1, Localiser:

    Code:
    Var 0, Value 0
    {
     &Motor_5 = 120
     IF &Motor_5 = 120
     {
      &Motor_5 = 250
     }
    }
    
    Var 7586, name LOC, Link FSUIPC_IN, Offset $0C48, Length 1, Type 1     // FSUIPC LOC Source
    {
     L0 = &LOC + 127
     &New_LOC = L0
    }
    
    Var 2837, name Potentiometer2, Link SUBRUTINE
    {
     L0 = &Pot_Orig2 * -1
     L0 = L0 + 180
     &Pot2 = L0
     CALL &Value_Calc2
    }
    
    Var 2721, name Motor_5, Link USB_DCMOTOR, Output 5     // Motor
    
    Var 5847, name Pot_Orig2, Link USB_ANALOGIC, Input 1, PosL 0, PosC 127, PosR 250     // Potentiometer
    {
     CALL &Potentiometer2
    }
    
    Var 2821, name New_LOC
    
    Var 1875, name Pot2
    
    Var 8570, name Value_Calc2, Link SUBRUTINE     // Provides a scale between GS and Pot
    {
     L0 = &Pot2 * 2.731
     &Calc2 = L0
     CALL &Position2
    }
    
    Var 3765, name Calc2     // Calculation holding variable
    
    Var 1726, name Position2, Link SUBRUTINE     // The Calculations for driving the motor
    {
      IF &Calc2 > &New_LOC
     {
      &Motor_5 = 190
     }
      ELSE
      {
       IF &Calc2 < &New_LOC
       {
        &Motor_5 = 85
       }
        ELSE
        {
         IF &Calc2 = &New_LOC
         {
          &Motor_5 = 128
         }
        }
      }
    }
    File 2, Glideslope:

    Code:
    Var 0, Value 0
    {
     &Motor_1 = 120
     IF &Motor_1 = 120
     {
      &Motor_1 = 250
     }
    }
    
    Var 53 link FSUIPC_IN Length 1 Offset $023A   // seconds of FS time  (0 - 59)
    {
     IF &New_GS = 119
     {
      IF &GS_Flag = 0
      {
      &New_GS = 0
      }
     }
    }
    
    Var 0005, name GS_Flag, Link FSUIPC_IN, Offset $0C4C, Length 1 // FSUIPC GS FLAG Source
    
    Var 0866, name GS, Link FSUIPC_IN, Offset $0C49, Length 1, Type 1  // FSUIPC GS Source
    {
     L0 = &GS + 119
     &New_GS = L0
    }
    
    Var 97, name Potentiometer, Link SUBRUTINE
    {
     L0 = &Pot_Orig * -1
     L0 = L0 + 171
     &Pot = L0
     CALL &Value_Calc
    }
    
    Var 1, name Motor_1, Link USB_DCMOTOR, Output 1     // Motor
    
    Var 58, name Pot_Orig, Link USB_ANALOGIC, Input 2, PosL 0, PosC 127, PosR 250     // Potentiometer
    {
     CALL &Potentiometer
    }
    
    Var 9991, name New_GS
    
    Var 8754, name Pot
    
    Var 3, name Value_Calc, Link SUBRUTINE     // Provides a scale between GS and Pot
    {
     L0 = &Pot * 3.260
     &Calc = L0
     CALL &Position
    }
    
    Var 30, name Calc     // Calculation holding variable
    
    Var 2, name Position, Link SUBRUTINE     // The Calculations for driving the motor
    {
      IF &Calc > &New_GS
     {
      &Motor_1 = 250
     }
      ELSE
      {
       IF &Calc < &New_GS
       {
        &Motor_1 = 120
       }
        ELSE
        {
         IF &Calc = &New_GS
         {
          &Motor_1 = 128
         }
        }
      }
    }
    As you can see, nothing is wrong. You can even try it yourself; seperately they compile, but not together - And there are no variable name clashes.

    Regards,

    Jack

Page 5 of 6 FirstFirst 123456 LastLast