Results 1 to 6 of 6

Thread: SIOC Help

  1. #1
    1000+ Poster - Fantastic Contributor
    Join Date
    Nov 2008
    Location
    Europe
    Posts
    1,934
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    SIOC Help

    Can someone please help me understand this little piece of SIOC code as I have ordered an opencockpits servo card to control 3 of 4 of my engine instruments for my Cessna.

    Here is the code for a vertical speed instrument which will work in the same way as an engine instrument:

    Var 0010, Link FSUIPC_IN, Offset $02C8, Length 4, Type 1 // Vertical Speed
    {
    L0 = V0010 * 0.7895 // FSUIPC conversion
    L1 = L0 * 0.085166 // 12000 FPM = 1022 positions
    L2 = 511 - L1 // Center
    IF L2 > 1022 // Upper limit
    {
    L2 = 1022
    }
    IF L2 < 1 // Lower Limit
    {
    L2 = 1
    }
    V0000 = L2
    }
    Var 0000 // Servo Motor


    First Line: Communicates with FSUIPC, names the offset which is the vertical speed indicator...

    When it states LENGTH does that mean the number of movements (and it will move between these movements)....

    So a vertical speed indicator has 4 movements... from the centre up 2... and from the center down 2.

    What does the ''Type 1 // Vertical Speed'' mean? Is this strictly just a name only?

    The rest of the code confuses me, as I don't know what the characters are supposed to represent.


    As you can see its pretty crazy inside my head trying to understand, if I only know what the characters were such as L2 = 1, V0000 = L2 etc etc etc...

    I just cant wait to get some gauges working!

    Can anyone put me out of my misery?

    Thank you very much.

    Alex
    GA or the Highway!

  2. #2
    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: SIOC Help

    Alex

    Have you read the unfriendly manual for SIOC, available on their website? To answer your questions:

    LENGTH relates to how FSUIPC stores the data information ie 1, 2 or 4 bytes in length. SIOC needs to know how much data to read from FSUIPC

    The TYPE argument is not needed here, it generally is used to define the TYPE of switch or encoder that is related to the variable.

    The remainder of the code is converting the data format of FSUIPC Vertical Speed into 1022 positions that are then sent to the servo ie 0 is no movement, 511 is mid scale deflection and 1022 is full scale movement. The lines with commented upper or lower limits are there to trap any resultant figures that are greater or less than the servo`s ability to move eg over 1022 or less than 0, in which case the values are reset to the maximum/minimum that the servo can respond to.

    Regards

    David

  3. Thanks No Longer Active thanked for this post
  4. #3
    1000+ Poster - Fantastic Contributor
    Join Date
    Nov 2008
    Location
    Europe
    Posts
    1,934
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: SIOC Help

    Thanks David...

    I am a complete newbie to SIOC and have been dreading this since I first took glimpse of the idea of building my own gauges. The sooner I learn this the better.

    It makes perfectly good sense how you have explained it, and looking at the vertical speed SIOC it really does make sence, as I know generally what it all means now...

    I may have a go at building the vertical speed instrument and see how I get on...

    Cheers a bunch pal...

    Alex
    GA or the Highway!

  5. #4
    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: SIOC Help

    Alex

    Glad to help. As you are building your own instrument, you might find this article on Ian Sissons site useful.

    http://www.737ng.co.uk/djb/brake_pressure_gauge.pdf

    Also, I have just noticed that the SIOC code in your first post is incorrect, as it does not have a variable assigned to the servo motor eg

    var 0022, name VSI_SERVO, Link USB_SERVOS, Output 1, POSL 1, POSC 511, POSR 1022

    You may also need a device number, dependent on the number of devices in use.

    Good luck and don`t hesitate to ask again when further down the course!

    Regards

    David

  6. #5
    1000+ Poster - Fantastic Contributor
    Join Date
    Nov 2008
    Location
    Europe
    Posts
    1,934
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: SIOC Help

    Thanks David....

    I see that Ian has used gears, for the vertical speed I was thinking of directly attaching the pointer to the server arm, would this not be the case? Do you need gears, or are gears just to make movement easier because of the position of the servo?

    Thanks a bunch.

    Much appreciated....

    Alex
    GA or the Highway!

  7. #6
    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: SIOC Help

    Alex

    Most servos have a rotation limit of circa 180deg. If that suits your ASI gauge face then ok, if not, then you will need gearing to extend the servo rotation to match the sweep of the gauge face

    Regards

    David

  8. Thanks No Longer Active thanked for this post

Similar Threads

  1. Sioc / PM
    By mpl330 in forum OpenCockpits General Discussion
    Replies: 6
    Last Post: 02-07-2010, 01:26 PM
  2. Help with SIOC please?
    By Jake 747 400 in forum General Builder Questions All Aircraft Types
    Replies: 13
    Last Post: 11-20-2009, 07:00 PM
  3. Where can I get SIOC, please?
    By Jake 747 400 in forum General Builder Questions All Aircraft Types
    Replies: 1
    Last Post: 11-18-2009, 06:10 PM
  4. SIOC for MIP?
    By HondaCop in forum I/O Interfacing Hardware and Software
    Replies: 17
    Last Post: 07-21-2009, 07:48 AM
  5. N1 SET and SPD REF - SIOC
    By paoloj in forum OpenCockpits General Discussion
    Replies: 0
    Last Post: 10-28-2008, 04:23 AM