Page 7 of 7 FirstFirst ... 34567
Results 61 to 65 of 65
  1. #61
    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

    You are in danger of compounding error on error. The logic is flawed in at least one place, as per your last para above. Please take Nico`s advice - stop coding and rethink.

    David

  2. #62
    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

    No the subroutine has no effect at all (no output), that must be caused by something else.

    Yes I said that you should put the logic for motor control in the subroutine. Of course I meant the right logic, not yours.

    And now I really stop with this thread, I've had enough of it

  3. #63
    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

    Okay, how's this?

    Code:
    Var 0, Value 0
    {
     &Motor4 = 201
    }
    
    Var 0004, name Motor4, Link USB_DCMOTOR, Output 4
    
    Var 49, name P, Link SUBRUTINE,
    {
     C0 = &CRS = 0
     C1 = &CRS = 360
     IF C0 OR C1
     {
      IF &A42 = 130
      {
       &Motor4 = 129
      }
       ELSE
       {
        &Motor4 = 201
       }
     }
    }
    
    Var 0005, name CRS, Link FSUIPC_IN, Offset $0C4E, Length 2
    {
     CALL &P
    }
    
    Var 58, name A42, Link USB_ANALOGIC, Input 4, PosL 0, PosC 127, PosR 250
    {
     CALL &P
    }
    I appreciate you have stopped commenting on this thread. but just a simple "Yes" (if I have got your subrutine idea correct) or "No" (if I have still not done what you said) would suffice, if you are still willing.

    Jack

  4. #64
    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

    YEEEEAAAAHHAAAAA!

    I finally got it working with TWO degrees now.

    The CRS pointer now stops at 355 and 360 degrees. And, although laborious, I am starting the process of doing all 359 degrees.

    Woo!

    This was my final script.

    The 360 degree script:

    Code:
    Var 0, Value 0
    {
     &Motor4 = 201
     &control = 0
     &control = TIMER 1 0 5
    }
    
    Var 158 name control Link SUBRUTINE
    {
     CALL &P2
    }
    
    Var 0004, name Motor4, Link USB_DCMOTOR, Output 4
    
    Var 49, name P, Link SUBRUTINE,
    {
     IF &Motor4 = 129
     {
      C0 = &CRS < 360
      C1 = &CRS > 0
      IF C0 AND C1
      {
       IF &A42 = 130
       {
        &Motor4 = 201
       }
      }
     }
    }
    
    Var 0005, name CRS, Link FSUIPC_IN, Offset $0C4E, Length 2
    {
     CALL &P
    }
    
    Var 58, name A42, Link USB_ANALOGIC, Input 4, PosL 0, PosC 127, PosR 250
     {
     C0 = &CRS = 0
     C1 = &CRS = 360
     IF C0 OR C1
     {
      IF &A42 = 130
      {
       &Motor4 = 129
      }
       ELSE
       {
        &Motor4 = 201
       }
     }
    }
    The 355 degree script:

    Code:
    Var 49, name P1, Link SUBRUTINE
    {
     IF &Motor4 = 129
     {
      C0 = &CRS1 < 355
      C1 = &CRS1 > 355
      IF C0 OR C1
      {
       IF &A42 = 134
       {
        &Motor4 = 201
       }
      }
     }
    }
    
    Var 0005, name CRS1, Link FSUIPC_IN, Offset $0C4E, Length 2
    {
     CALL &P1
    }
    
    Var 50, name P2, Link SUBRUTINE,
    {
     IF &CRS = 355
     {
      IF &A42 = 134
      {
       &Motor4 = 129
      }
       ELSE
       {
        &Motor4 = 201
       }
     }
    }
    Both of the above were compiled together.

    So yes, everything is working! For now...

  5. #65
    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
    but just a simple "Yes" (if I have got your subrutine idea correct) or "No" (if I have still not done what you said) would suffice, if you are still willing.
    YES, this is what I meant, but you should update the body of Subroutine P with the right logic.

    Regarding your second post with as well a subroutine P1 as a subroutine P2: NO THAT'S NOT RIGHT! Now again you have created more places where you control the motor, don't do that.! Do not write 360 scripts (which is not very efficient, to say the least ..............) , but write ONE control script in subroutine P.
    I could write it in an hour, but I'll leave it to you as an exercise.

    Nico
    Last edited by kiek; 04-21-2011 at 11:53 AM.

Page 7 of 7 FirstFirst ... 34567

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