Page 7 of 11 FirstFirst ... 34567891011 LastLast
Results 61 to 70 of 101
  1. #61
    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: USBServos Software not working?

    Okay lads, hows about this: (ServoT.ssi)

    Code:
    // *****************************************************************************
    // * Config_SIOC ver 3.7B1   -     By Manolo Vélez    -    www.opencockpits.com
    // *****************************************************************************
    // * FileName : ASIgauge.txt
    // * Date : 7/3/2010
    
    
    
    Var 0000, Value 0, name Intialization     // Set servo positions
    {
      &Servo4 = 367   
    }
    
    Var 9000, name Servo4, Link USB_SERVOS, Output 1, PosL 367, PosC 637, PosR 907, Type 2     // ASI gauge
    
    Var 9003, name IAS, Link FSUIPC_INOUT, Offset $02BC, Length 4     // IAS from SIm
    {
      L0 = &IAS / 1.5
      &Servo4 = L0 + 213
      IF L0 < 50
      {
        &Servo4 = 367    
      }
      IF L0 > 350
      {
        &Servo4 = 907    
      }
    }
    And SIOC.ini:

    Code:
    [SIOC]
    IOCP_port=8092
    IOCP_timeout=4000
    Minimized=Yes
    toggle_delay=20
    CONFIG_FILE=ServoT.ssi
    
    [IOCARDS MODULE]
    IOCard_disable=No
    IOCard_LPT=No
    
    USBSERVOS=1,77
    
    [FSUIPC MODULE]
    FSUipcdisable=No
    FSUipcRefresh=50
    
    [IOCP CLIENTS MODULES]
    IOCPini_delay=3000
    IOCPclient0_disable=Yes
    IOCPclient0_host=localhost
    IOCPclient0_port=8090
    IOCPclient1_disable=Yes
    IOCPclient1_host=localhost
    IOCPclient1_port=8099
    
    [SOUND MODULE]
    Sound_disable=Yes
    Volume=100
    I know the SIOC.ini is wrong though.

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

    Re: USBServos Software not working?

    Quote Originally Posted by kiek View Post
    Hi Rob,
    Thanks for your example. It will show Jack how to use Var 0.

    Just a tip: in your script you are using (at several places) a Var definition linked to a FSUIPC_INOUT offset. However, in your program you only use the IN part (never the OUT part). It would be better to replace all these FSUIPC_INOUT's by FSUIPC_IN's. This will better express what you are doing and it will result in a simpler execution by SIOC, costing less cpu cycles).

    best regards,
    Nico
    Thanks! I will make the changes as cycle time will become important when i bring all my scripts together.

  3. #63
    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: USBServos Software not working?

    Although semantically the same, this is better code:

    Code:
    Var 9003, name IAS, Link FSUIPC_IN, Offset $02BC, Length 4     // IAS from SIm
    {
      L0 = &IAS / 1.5
      &Servo4 = L0 + 213
      IF L0 < 50
      {
        &Servo4 = 367    
      }
      ELSE
      {
        IF L0 > 350
        {
         &Servo4 = 907  
        }  
      }
    }
    FSUIPC_IN because you are only reading from the offset (not writing to the offset)

    IF L0 < 50 there is no need to test whether it is also > 350 (because it is not) so you better use an IF ELSE statement to save cpu time


    Nico

  4. #64
    75+ Posting Member
    Join Date
    Apr 2009
    Location
    Toronto
    Posts
    125
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: USBServos Software not working?

    Code:
    Var 9003, name IAS, Link FSUIPC_IN, Offset $02BC, Length 4     // IAS from SIm
    {
      L0 = &IAS / 1.5
      &Servo4 = L0 + 213
      IF L0 < 50
      {
        &Servo4 = 367    
      }
      ELSE
      {
        IF L0 > 350
        {
         &Servo4 = 907  
        }  
      }
    }

    I don't have a servo card, so I may not be understanding this well; but, I assume that the intention is to produce a result such that: 366 < &Servo4 < 908.
    The above code doesn't do that. Consider: &IAS=120; L0=80; &Servo4 = 293.

    Maybe:

    Code:
    Var 9003, name IAS, Link FSUIPC_IN, Offset $02BC, Length 4     // IAS from SIm
    {
      L0 = &IAS / 1.5
      &Servo4 = L0 + 213
      IF &Servo4 < 367 
      {
        &Servo4 = 367    
      }
      ELSE
      {
        IF &Servo4 > 907
        {
         &Servo4 = 907  
        }  
      }
    }
    or

    Code:
    Var 9003, name IAS, Link FSUIPC_IN, Offset $02BC, Length 4     // IAS from SIm
    {
      &Servo4 = &IAS / 1.5
      &Servo4 = LIMIT 367,907,213
    }
    I don't know why it's necessary to do this, though. The limits are already defined:

    Code:
    Var 9000, name Servo4, Link USB_SERVOS, Output 1, PosL 367, PosC 637, PosR 907
    SIOC ought to impose them.

    Jim

  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: USBServos Software not working?

    Hi Jim,
    Quote Originally Posted by deering View Post
    Code:
    Var 9003, name IAS, Link FSUIPC_IN, Offset $02BC, Length 4     // IAS from SIm
    {
      L0 = &IAS / 1.5
      &Servo4 = L0 + 213
      IF L0 < 50
      {
        &Servo4 = 367    
      }
      ELSE
      {
        IF L0 > 350
        {
         &Servo4 = 907  
        }  
      }
    }
    I had no intention to write correct code for his application. I was only showing some SIOC constructs.
    Note: Your example code (above) is not right i'm afraid, because you already write a too low value (293) to &servo4 before you test the limits in the next statement....

    Nico

  6. #66
    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: USBServos Software not working?

    Okay, I'll remove the limits then as they seem to be causing some questions to be raised. Hows about this (limits removed):

    Code:
    Var 0000, Value 0, name Intialization     // Set servo positions
    {
      &Servo4 = 367   
    }
    
    Var 9000, name Servo4, Link USB_SERVOS, Output 1, PosL 367, PosC 637, PosR 907, Type 2     // ASI gauge
    
    Var 9003, name IAS, Link FSUIPC_INOUT, Offset $02BC, Length 4     // IAS from SIm
    {
      L0 = &IAS / 1.5
      &Servo4 = L0 + 213
    Combined with this SIOC.ini:

    Code:
    [SIOC]
    IOCP_port=8092
    IOCP_timeout=4000
    Minimized=Yes
    toggle_delay=20
    CONFIG_FILE=ServoT.ssi
    
    [IOCARDS MODULE]
    IOCard_disable=No
    IOCard_LPT=No
    
    USBSERVOS=1,77
    
    [FSUIPC MODULE]
    FSUipcdisable=No
    FSUipcRefresh=50
    
    [IOCP CLIENTS MODULES]
    IOCPini_delay=3000
    IOCPclient0_disable=Yes
    IOCPclient0_host=localhost
    IOCPclient0_port=8090
    IOCPclient1_disable=Yes
    IOCPclient1_host=localhost
    IOCPclient1_port=8099
    
    [SOUND MODULE]
    Sound_disable=Yes
    Volume=100
    Will it let the ASI Servo work? If there are any problems, please highlight them (even if it's just that I've put a line or a space in the wrong position).

    Thank you very much,

    Jack

  7. #67
    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: USBServos Software not working?

    Hi Jack,
    Like I wrote earlier in this thread, the FSUIPC definition for offset 0x0B2C reads:

    IAS: Indicated Air Speed, as knots * 128

    I do not see your algorithm taking care of that.... Should you not divide by 128 get IAS in knots first?
    And why do you divide by 1.5? What's the reasoning behind that?

    Nico

  8. #68
    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: USBServos Software not working?

    Hi Nico,

    Yes I understand dividing by 128, it makes perfect sense. Not really sure why it's /1.5 I will change it now. Anything else I need to take care of? Is the SIOC.ini okay?

    Also, should I change 213 to 205 as that's my "0" value, although my phyiscal ASI only starts at 50Knots.

  9. #69
    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: USBServos Software not working?

    Jack

    The reason why it is 1.5 is that was the figure in the "sample" sioc text I gave you a while back. I also said in a previous post

    " Yes, there is more code ammendment required - for example you will need to establish whether the multiplier 1.5 or indeed the + value of 213 is correct"

    David

  10. #70
    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: USBServos Software not working?

    Thanks David, all is corrected. Interestingly, I actually noticed that the /1.5 was wrong after looking at the SDK manual, but forgot to correct!

    So, before I finally boot up FSX and test, are there any errors in the following SIOC script:

    Code:
    // *****************************************************************************
    // * Config_SIOC ver 3.7B1   -     By Manolo Vélez    -    www.opencockpits.com
    // *****************************************************************************
    // * FileName : ASIgauge.txt
    // * Date : 7/3/2010
    
    
    
    Var 0000, Value 0, name Intialization     // Set servo positions
    {
      &Servo4 = 205  
    }
    
    Var 9000, name Servo4, Link USB_SERVOS, Output 1, PosL 205, PosC 468, PosR 730, Type 2     // ASI gauge
    
    Var 9003, name IAS, Link FSUIPC_INOUT, Offset $02BC, Length 4     // IAS from SIm
    {
      L0 = &IAS / 128
      &Servo4 = L0 + 213
      IF L0 < 50
      {
        &Servo4 = 205  
      }
      IF L0 > 350
      {
        &Servo4 = 730    
      }
    }
    And SIOC.ini:

    Code:
    [SIOC]
    IOCP_port=8092
    IOCP_timeout=4000
    Minimized=Yes
    toggle_delay=20
    CONFIG_FILE=ServoT.ssi
    
    [IOCARDS MODULE]
    IOCard_disable=No
    IOCard_LPT=No
    
    USBSERVOS=1,77
    
    [FSUIPC MODULE]
    FSUipcdisable=No
    FSUipcRefresh=50
    
    [IOCP CLIENTS MODULES]
    IOCPini_delay=3000
    IOCPclient0_disable=Yes
    IOCPclient0_host=localhost
    IOCPclient0_port=8090
    IOCPclient1_disable=Yes
    IOCPclient1_host=localhost
    IOCPclient1_port=8099
    
    [SOUND MODULE]
    Sound_disable=Yes
    Volume=100
    Any mistakes feel free to point 'em out!

Page 7 of 11 FirstFirst ... 34567891011 LastLast

Similar Threads

  1. Replies: 11
    Last Post: 02-28-2011, 04:09 PM
  2. Real-World Aircraft Instruments interfaced to FSX via SIOC & USBServos
    By Boeing 747 Flyer in forum My Cockpit Update
    Replies: 1
    Last Post: 08-07-2010, 08:58 AM
  3. USBSERVOS Card testing
    By Tripacer in forum OpenCockpits General Discussion
    Replies: 3
    Last Post: 01-14-2009, 12:25 AM
  4. USBServos Card Testing
    By Tripacer in forum OpenCockpits General Discussion
    Replies: 1
    Last Post: 12-07-2008, 12:37 AM
  5. What are you working on?
    By Bob Reed in forum My Cockpit Update
    Replies: 21
    Last Post: 12-22-2006, 12:22 PM