Page 5 of 7 FirstFirst 1234567 LastLast
Results 41 to 50 of 65
  1. #41
    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: "Inner Circle" HSI - SIOC DC Motors Card Script

    Quote Originally Posted by fordgt40 View Post
    though I suspect again that your knowledge of SIOC is not to the standard required for such a task. Again, as previously advised, you should focus on becoming fully versant with less demanding SIOC coding before tackling this exercise.

    David
    Heheheh, you should see some of the scripts I have done in my free time. They are far more demanding than you may think. Here's one I wrote earlier this year:

    Code:
    Var 7777, Link FSUIPC_IN, Offset $3AB0, Length 8, Numbers 0     // EGT2
    {
      L0 = V7777 - 459.67     // FSUIPC Conversion Rankine -> Celcius
      L0 = L0 - 32
      L0 = L0 * 5
      L0 = L0 / 9
      L0 = ABS L0     // L0 not signed 
      L2 = L0    
      IF L0 <= 100     // First sector
      {
        L1 = L2 * 0.07     // (7 steps/100 values) = 0.07
      }
      ELSE     // Is a greater value
      {
        L2 = L0 - 100     //  L2 only have values for next sector
        IF L0 <= 200     // Second sector
        {
          L1 = L2 * 1.37     // (137 steps / 100 values) = 1.37
          L1 = L1 + 7     // Add steps of others sectors (+7)
        }
        ELSE
        {
          L2 = L0 - 200     // L2 only have values for next sector
          IF L0 <= 500     // 3. Sector
          {
            L1 = L2 * 1.463     // ( 439 / 300) = 1.463
            L1 = L1 + 144     // Add steps of others sectors (7 + 137) 
          }
          ELSE     // Out of range
          {
            L2 = L0 - 500     //  L2 only have values for next sector
            IF L0 <= 800     // 4. sector
            {
              L1 = L2 * 1.437     // (431 steps / 300 values) = 1.437
              L1 = L1 + 583     // Add steps of others sectors (7 + 137 + 4
            }
            ELSE
            {
              L1 = 1014         // Max. position
            }
          }
        }
      }
      &Servo1 = 0 + L1     // Add to minimum (0)
    }
    Besides, what an earth have I done wrong in SIOC so far, since the introduction of Gery's script?

    I have simply asked how it can be factorised, that's all. Nothing else.

    0 = 130
    1 = 128
    2 = 126

    And so on... As you can see, linear, but I cannot personally factorise it.

    Thank you, once again, for the explanation of Hex, it is helpful.

    Jack

  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: "Inner Circle" HSI - SIOC DC Motors Card Script

    Jack

    Good luck then, I will be gentle and not answer your question

    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: "Inner Circle" HSI - SIOC DC Motors Card Script

    Quote Originally Posted by fordgt40 View Post
    Jack

    Good luck then, I will be gentle and not answer your question

    David
    What else should I expect from a SIOC question thread!

    I don't see how your comment is appropriate to this thread, I'm sorry. From now on, I'd only like post related directly to the scaling of the HSI which is, interestingly, the title of this thread.

    For those of you who can answer: Using Gery's method, how could I factorise 0 = 130, and 1 = 128? I can only see this method working if the pot is at 0 at 0 degrees.

  4. #44
    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: "Inner Circle" HSI - SIOC DC Motors Card Script

    Quote Originally Posted by Boeing 747 Flyer View Post
    I have absolutely no idea how to convert backwards. Using online calculators, we frequently see the reading "7B", whatever that means.
    7B means 7 * 16 + 11 = 123 ...

    I was only trying to help you to learn the difference between number notations (binary, decimal and hexadecimal for instance). You have to understand that if you are using FSUIPC offsets or lekseecon variables. Some of my Lekseecon variables are coded in hex (like the clocks 846 and 847, the COMM displays 852 and 853 , ...).

    Nico
    Last edited by kiek; 04-18-2011 at 12:12 PM.

  5. #45
    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: "Inner Circle" HSI - SIOC DC Motors Card Script

    Hi Matt,
    Quote Originally Posted by Matt Olieman View Post
    PLEASE for our sake, keep it on topic.
    We would love to, but it all started when Jack wrote this (in post #26):

    To me, a decimal is 13.8, 56.9, etc. 64 is not a decimal?

    So we tried to teach Jack number notations first....

    Nico
    Last edited by kiek; 04-18-2011 at 12:44 PM.

  6. #46
    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: "Inner Circle" HSI - SIOC DC Motors Card Script

    Thank you Nico for the further explanation. It seems I have some mathematical work to do.

    Anyway, back on topic. I've been working my brain tying to solve the Pot V Motor problem.

    0 degrees = 130

    1 degrees = 128

    2 degrees = 126 (actually 127 because it decreases by 1.87 each time, not 2, but such a small difference).

    And so on...

    Does anyone know, using Gery's method, how the Pot values can be factorised? Am I wrong in thinking that his method only works if Pot 0 = Degrees 0?

    Jack

  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: "Inner Circle" HSI - SIOC DC Motors Card Script

    Hi guys,

    Just an idea... Although this method is labour intensive...

    I could hand-assign each potentiometer value to its respective heading value, and tell SIOC to stop the motor if it is equal to the offset, ELSE move =ve/-ve.

    EDIT: I have decided to go ahead with this method.

    Please see above.

  8. #48
    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: "Inner Circle" HSI - SIOC DC Motors Card Script

    HI everyone,

    I'm having trouble with the method below.

    I developed a test script. For 90% of the instrument, this script is inactive; it only works in the range heading 346-004.

    Can anyone tell me why, whenever "P" changes value, it's subsequent brackets are completely ignored by SIOC and not executed? My motor just continously spins in a single direction, never changing according to P, like it should...

    Code:
    Var 0004, name Motor4, Link USB_DCMOTOR, Output 4
    
    Var 0005, name CRS, Link FSUIPC_IN, Offset $0C4E, Length 2
    
    Var 2, name P
    {
     IF &P > &CRS
     {
      &Motor4 = 123
     }
      ELSE
      {
       IF &P < &CRS
      {
       &Motor4 = 253
      }
       ELSE
       {
        IF &P = &CRS
        {
         &Motor4 = 128
        }
       }
     }
    }
    
    Var 1, name A4, Link USB_ANALOGIC, Input 4, PosL 0, PosC 127, PosR 250
    {
     IF &A4 = 140
     {
      &P = 346
     }
      ELSE
      {
       IF &A4 = 139
       {
        &P = 347
       }
        ELSE
        {
         IF &A4 = 138
         {
          &P = 349
         }
          ELSE
          {
           IF &A4 = 137
           {
            &P = 350
           }
            ELSE
            {
             IF &A4 = 136
             {
              &P = 352
             }
              ELSE
             {
              IF &A4 = 135
              {
               &P = 353
              }
               ELSE
               {
                IF &A4 = 134
                {
                 &P = 354
                }
                 ELSE
                {
                 IF &A4 = 133
                 {
                  &P = 356
                 }
                  ELSE
                  {
                   IF &A4 = 132
                   {
                    &P = 357
                   }
                    ELSE
                    {
                     IF &A4 = 131
                     {
                      &P = 359
                     }
                      ELSE
                     {
                      IF &A4 = 130
                      {
                       &P = 000
                      }
                       ELSE
                      {
                       IF &A4 = 129
                       {
                        &P = 001
                       }
                        ELSE
                        {
                         IF &A4 = 128
                         {
                          &P = 002
                         }
                          ELSE
                          {
                           IF &A4 = 127
                           {
                            &P = 004
                           }
                          }
                         }
                        }
                       }
                      }
                     }
                    }
                   }
                  }
                 }
                }
               }
              }
             }
    Maybe Nico can shed some light if I have done something wrong. There is nothing wrong mechanically. As I said, the brackets following Var P are completely ignored, even when it changes value (appeals for reasons).

    Jack

  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: "Inner Circle" HSI - SIOC DC Motors Card Script

    Hi everyone,

    According to Hessel Oosten's guide, it says that "128" commands the motor to stop.

    This is definitely not true; it causes my motors to go very fast instead.

    I made a script that when CRS = 0, Motors = 128 (stop).

    However, when the CRS hit 0, the motors shot up in speed, before going back down after surpassing 0.

    Weird huh?

    Jack

  10. #50
    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: "Inner Circle" HSI - SIOC DC Motors Card Script

    Hi Jack,
    Quote Originally Posted by Boeing 747 Flyer View Post
    As I said, the brackets following Var P are completely ignored, even when it changes value (appeals for reasons).
    Computers are not like humans... Brackets are not ignored because SIOC does not like you, if they are not executed, then you may conclude that var P never changed value...
    And how come P never changes value? Maybe because var A4 is outside the range 127 - 140? Please check.

    Nico

Page 5 of 7 FirstFirst 1234567 LastLast

Similar Threads

  1. DC Motors Card - How to use in SIOC?
    By Boeing 747 Flyer in forum OpenCockpits General Discussion
    Replies: 4
    Last Post: 04-20-2017, 09:11 PM
  2. Expansion card buggy? Shows "ghost" inputs where there aren't...
    By Michael737NG in forum OpenCockpits General Discussion
    Replies: 0
    Last Post: 12-26-2010, 07:02 AM
  3. SIOC "IF" Question
    By Boeing 747 Flyer in forum OpenCockpits General Discussion
    Replies: 89
    Last Post: 08-29-2010, 05:34 PM
  4. FSX "This graphics card does not meet minimum ..." HELP !!!!
    By ibennett in forum Computer Hardware Setup
    Replies: 5
    Last Post: 04-12-2010, 09:46 PM
  5. Replies: 17
    Last Post: 03-05-2008, 12:39 PM