Page 1 of 3 123 LastLast
Results 1 to 10 of 27
  1. #1
    300+ Forum Addict jmig's Avatar
    Join Date
    Apr 2007
    Location
    Lafayette, LA USA
    Posts
    440
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    SIOC Everything looks good, BUT.....

    not working in FSX.

    I have been struggling to learn SIOC. So I pulled the IO Master card and USB card from my cockpit and built a test setup. I have a panel with a series of switches, push buttons, encoder, and axes pot. My goal is to slowly learn to write to each item.

    Today I spent hours writing simple code (shown below) to three toggle switches. A master avionics switch, battery switch and generator switch. The txt was complied with no problem by SIOC into a ssi file, which loads fine. The switches show and work in the controller panel. However, not in the game. Nothing, nada. I even changed the offest on the first switch to $0280 (Lights) and couldn't get it to work.

    Any ideas?

    Code:
    Var 0005, name masterSW, Link FSUIPC_OUT, Offset $2E80, Length 4 // Master switch

    Var 0006, Link IOCARD_SW, Input 000 Type I // Master switch
    {
    IF V0006 = 1 // If the switch is on
    {
    V0005 = SETBIT 2 // Set Bit 2
    V0007 = 1 // Turn on the LED
    }
    ELSE // If the switch is off
    {
    V0005 = CLEARBIT 2
    V0007 = 0 // Turn off the led
    }
    }

    Var 0007, Link IOCARD_OUT, Output 38 // Led Not currently set up ck output #


    Var 0008, name batterySW, Link FSUIPC_OUT, Offset $281C, Length 4 // Battery switch

    Var 0009, Link IOCARD_SW, Input 001 Type I // Battery switch
    {
    IF V0009 = 1 // If the switch is on
    {
    V0008 = SETBIT 2 // Set Bit 2
    V0010 = 1 // Turn on the LED
    }
    ELSE // If the switch is off
    {
    V0008 = CLEARBIT 2
    V0010 = 0 // Turn off the led
    }
    }

    Var 0010, Link IOCARD_OUT, Output 39 // Led Not currently set up ck output #



    Var 0011, name GenSW, Link FSUIPC_OUT, Offset $3B78, Length 4 // Generator switch

    Var 0012, name Generator Link IOCARD_SW, Input 002 Type I // Generator
    {
    IF &Generator = 1 // If the switch is on
    {
    &GenSW = SETBIT 2 // Set Bit 2
    V0013 = 1 // Turn on the LED
    }
    ELSE // If the switch is off
    {
    &GenSW = CLEARBIT 2
    V0013 = 0 // Turn off the led
    }
    }

    Var 0013, Link IOCARD_OUT, Output 40 // Led Not currently set up ck output #
    John

    System:
    ASUS P5Q SE/R
    Intel Q9550 O/C to 3.4 GHz
    4 GB 1066 DDR2 RAM
    300 GB WD 10,000 RPM Raptor SATA Drive
    GeForce 8800 GT 512 KB RAM
    Matrox TH2Go with three 19" Sumsung 940 BX
    IR Track 4

  2. #2
    25+ Posting Member Oter3's Avatar
    Join Date
    Mar 2007
    Location
    Norway
    Posts
    33
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Hello.
    Not to take a too big bite I will just try to give you a
    hint of what to and I have only looked at the first
    part of your code.
    From FSUIPC Offsets list:
    2E80. Master avionics switch (0=Off, 1=On).
    Read/Write.
    The offset is given value 1 or 0. Bits in the offset is
    not changed.
    If you write standard SIOC code with above FSUIPC spec it
    will work.
    The radios and nav. is turned on/off and as ekxample the
    B.Baron has a Av.sw in its panel that clearly goes upp and
    down!

    Regards
    Nils

  3. #3
    300+ Forum Addict jmig's Avatar
    Join Date
    Apr 2007
    Location
    Lafayette, LA USA
    Posts
    440
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Quote Originally Posted by Oter3 View Post
    Hello.
    Not to take a too big bite I will just try to give you a
    hint of what to and I have only looked at the first
    part of your code.
    From FSUIPC Offsets list:
    2E80. Master avionics switch (0=Off, 1=On).
    Read/Write.
    The offset is given value 1 or 0. Bits in the offset is
    not changed.
    If you write standard SIOC code with above FSUIPC spec it
    will work.
    The radios and nav. is turned on/off and as ekxample the
    B.Baron has a Av.sw in its panel that clearly goes upp and
    down!

    Regards
    Nils
    Nils - Thanks for responding. I am confused however. What do you mean by "standard SIOC code?" I thought my code was correct? It is from examples given.

    I was able to get the switched to work using the IOPC program. But, I would still like to learn and use SIOC.
    John

    System:
    ASUS P5Q SE/R
    Intel Q9550 O/C to 3.4 GHz
    4 GB 1066 DDR2 RAM
    300 GB WD 10,000 RPM Raptor SATA Drive
    GeForce 8800 GT 512 KB RAM
    Matrox TH2Go with three 19" Sumsung 940 BX
    IR Track 4

  4. #4
    150+ Forum Groupie sas550's Avatar
    Join Date
    May 2007
    Location
    Sweden
    Posts
    236
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Remember to rename the file to "sioc.ssi". Otherwise it won't work.
    Regards Anders Eriksson


    www.simcockpit.se

    FS9

  5. #5
    150+ Forum Groupie sas550's Avatar
    Join Date
    May 2007
    Location
    Sweden
    Posts
    236
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Here's my battery code in a simpler way.


    Var 0012, name Battery, Link FSUIPC_OUT, Offset $281C, Length 4

    Var 0009, name Battery_Master, Link IOCARD_SW, Input 14
    {
    IF &Battery_Master = 1
    {
    &Battery = 1
    }
    ELSE
    {
    &Battery = 0
    }
    }

    Var 0026, Link IOCARD_OUT, Output 20 // battery_led

    {
    IF &Battery = 1
    {
    V0026 = 1
    }
    ELSE
    {
    V0026 = 0
    }
    }

    (had to edit some code)
    Regards Anders Eriksson


    www.simcockpit.se

    FS9

  6. Thanks jmig thanked for this post
  7. #6
    150+ Forum Groupie pdpo's Avatar
    Join Date
    Nov 2005
    Location
    belgium
    Posts
    280
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Hey Imig,

    I find also something strange in your code. Your are setting and clearing bits in offset 2e80 but this is defined as only output. SIOC needs the input value too to be able to set or clear a bit so I think you should define offset 2e80 as FSUIPC_INOUT.
    Just my two cents.
    If you wanna use 2e80 as output to fsuipc only then you need to write a value to it... like
    if V0006 = 1
    {
    V0005 = 1
    }
    else
    {
    V0005 = 0
    }

    Just my two cents.....

    Greetings Peter Depoortere

  8. #7
    25+ Posting Member Oter3's Avatar
    Join Date
    Mar 2007
    Location
    Norway
    Posts
    33
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    .... it all looks well, but.

    Hei,
    I did not meen to make you confused.
    Stamdard code was not the right word, what I ment was: start with basic code and implement the setbit, clearbit functions later. They can be tricky!
    Now it looks like it's well explained above.
    Good luck.
    Nils

  9. #8
    10+ Posting Member
    Join Date
    Feb 2008
    Location
    Canada
    Posts
    19
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Quote Originally Posted by jmig View Post
    not working in FSX.
    V0005 = SETBIT 2 // Set Bit 2
    V0005 = CLEARBIT 2
    I'm not sure whether this will help but here are a couple of observations:

    1) Looking at the 28th Release of FSUIPC SDK, the variables you're trying to alter (e.g. $2E80) are listed as simply 1 and 0 where only BIT 0 is used. No other bits are used (so you don't need to attempt to alter a SPECIFIC bit at this time). But in YOUR code, you're attempting to alter BIT 2. (Try changing your code to "SETBIT 0", etc or to a simple ASSIGNMENT as in the examples from the other replies.)

    2) At the beginning of the FSUIPC programmers' guide, it says to refer to the "FSUIPC4 Offsets Status" document for use with FSX. And in the latter document, many FSX variables have little or no support yet so caution is advised. (Do your testing first using FS2004 if that is an option for you.)

  10. #9
    300+ Forum Addict jmig's Avatar
    Join Date
    Apr 2007
    Location
    Lafayette, LA USA
    Posts
    440
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    I want to thank each and everyone who replied to my post. I want to especially thank sas550 for the code example.

    My problem is that I grew up before computers I have never been comfortable with programming and have always used previous written code and modified it to meet my limited needs. With SIOC I have found it difficult because of the lack of simple examples.

    Most examples I have found either give you one snippet of code, such as, send a 0 or 1 to a FSUIPC offset. Or, turn on the LED. Or, they have a complete setup for an autopilot or EFIC.

    One isn't enough for me with my brain that struggles to understand this stuff and the other just confuses me. What I need are complete examples to flip a switch and tell FSX to raise the gear and maybe turn on the LED. another that allows me to say, use an encoder to set the altimeter baro setting.

    That is why I hope sas505's code snippet will help me. It seems complete. I know SIOC will someday help me. I will get this. But, building the cockpit was easy compared to trying to write code.

    Thanks again fellows. I have to leave later this morning for a week or so. When I return, I will try out your advice and code.
    John

    System:
    ASUS P5Q SE/R
    Intel Q9550 O/C to 3.4 GHz
    4 GB 1066 DDR2 RAM
    300 GB WD 10,000 RPM Raptor SATA Drive
    GeForce 8800 GT 512 KB RAM
    Matrox TH2Go with three 19" Sumsung 940 BX
    IR Track 4

  11. #10
    2000+ Poster - Never Leaves the Sim Michael Carter's Avatar
    Join Date
    Oct 2006
    Location
    Southern Illinois, USA
    Posts
    3,147
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    I'm with you. Developers think we're born with this knowledge or somehow absorb it through osmosis.

    The most sophisticated item in the house when I grew up was the Space Command for the Zenith television.
    Boeing Skunk Works
    Remember...140, 250, and REALLY FAST!

    We don't need no stinkin' ETOPS!



    Powered by FS9 & BOEING

Page 1 of 3 123 LastLast

Similar Threads

  1. Any good sioc script ?
    By 737NGPilot in forum PM Boeing FMC/CDU
    Replies: 2
    Last Post: 07-15-2010, 07:50 AM
  2. Good MCP for 737-800?
    By HondaCop in forum I/O Interfacing Hardware and Software
    Replies: 8
    Last Post: 07-17-2009, 06:09 AM
  3. Good Day All
    By DarylL in forum Welcome to MyCockpit New here? Introduce Yourself!
    Replies: 2
    Last Post: 12-06-2008, 05:13 PM
  4. good day
    By 747sim in forum Welcome to MyCockpit New here? Introduce Yourself!
    Replies: 22
    Last Post: 08-06-2008, 09:29 PM
  5. Is FSX any good???
    By Simran737 in forum General Builder Questions All Aircraft Types
    Replies: 11
    Last Post: 01-06-2008, 11:15 PM