Results 1 to 5 of 5
  1. #1
    75+ Posting Member MortenHa's Avatar
    Join Date
    Apr 2007
    Location
    Norway, Vardø
    Posts
    77
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Using SIOC variables

    Hi folks
    I am somewhat uncertain how to read SIOC code. Especially Variable declaration and its use. Got some experience in programming, but SIOC is a bit strange, and I need to see if I got this right:

    This is a declaration statement(?):
    Var 302, Name RecallSwitch, Link IOCARD_SW, Input 2

    If I want to use this variable in my programming, I can either:

    Refer to it this way(?): V302
    or
    by its name(?): RecallSwitch

    It is my understanding that these variables are global and they reside on the IOCP server(?)

    Let's say I have SIOC Clients running on two different computer. Can both computer use RecallSwitch in their programming script(?)

    I have also seen code examples where the Variable declarations are written after their first use, and this OK whenever(?)

    The documentation says that the script associated with the variable is run after there's an event resulting in a change in value.

    Making it possible for the script itself to contain code that would change the value yet again(?)

    Thanx in advance
    Morten

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

    Quote Originally Posted by MortenHa View Post
    This is a declaration statement(?):
    Refer to it this way(?): V302
    or
    by its name(?): RecallSwitch
    yes, although one should write &RecallSwitch


    Quote Originally Posted by MortenHa View Post
    It is my understanding that these variables are global and they reside on the IOCP server(?)
    Yes they are global but only within your SIOC script. The IOCP Server is a difficult to understand concept, forget about it for the time being.

    Quote Originally Posted by MortenHa View Post
    Let's say I have SIOC Clients running on two different computer. Can both computer use RecallSwitch in their programming script(?)
    Yes.


    Quote Originally Posted by MortenHa View Post
    I have also seen code examples where the Variable declarations are written after their first use, and this OK whenever(?)
    Yes (if you follow the compilation proces of config_sioc.exe you will notice that it is a three pass compilation, so 'define before use' is not needed)

    Quote Originally Posted by MortenHa View Post
    The documentation says that the script associated with the variable is run after there's an event resulting in a change in value.

    Making it possible for the script itself to contain code that would change the value yet again(?)
    Yes.


    regards,
    Nico
    www.lekseecon.nl/howto.html

  3. #3
    Boeing 777 Builder


    Kennair's Avatar
    Join Date
    Jan 2007
    Location
    Perth, Western Australia
    Posts
    730
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Hi Nico,

    Can I just say how much I appreciate your incredible input to our understanding of SIOC programming. I have studied your website and gained a lot of valuable information unobtainable from OC. Having written some instructional material myself in the past I understand the immense amount of time it takes, so you are to be commended for your efforts. OC should commission you to write their manuals

    Regards,

    Ken.
    Opencockpits | Aerosim Solutions | Sim-Avionics | P3D | FDS | FTX | AS16 | PPL | Kennair


  4. #4
    75+ Posting Member MortenHa's Avatar
    Join Date
    Apr 2007
    Location
    Norway, Vardø
    Posts
    77
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Thanx Nico!
    This really helps me! I'm a bit embarrassed that I didn't discover your homepage. That would have cleared things up to some extent. But I have bookmarked it now for future use.

    I'm slowly getting a feel for the language

  5. #5
    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

    Ken, Morton,

    Thank you both for your kind words. I'm glad to be of help.

    The SIOC concept is very powerful. In my opinion it is (one of) the (!) best tools world-wide for our application, home cockpit building.

    However, the "problem" is that you can use SIOC in different ways, from

    "easy": at a single PC (the Flightsim PC), with a single SIOC script and using FSUIPC offsets to communicate with FlightSimulator;

    via
    "easy but different": at a single PC (the Flightsim PC), with a single SIOC script and using IOCP Server to communicate with FlightSimulator variables (instead of FSUIPC offsets) ;

    to
    "very complex": several PCs, SIOC at each PC, multiple SIOC scripts at a PC, using IOCP protocol to communicate between SIOC apps, and IOCP Server to communicate with FlightSimulator, and so on..

    I'm trying to help people, by showing them the easy way (first)...

    Cheers!,
    Nico

Similar Threads

  1. FS2Phidgets / SIOC variables
    By mcdufall in forum FS2Phidget Users
    Replies: 2
    Last Post: 02-14-2011, 05:22 AM
  2. Variables ?
    By spitfire9 in forum FS2Phidget Users
    Replies: 7
    Last Post: 04-23-2010, 08:42 PM
  3. Variables
    By BOINET jean luc in forum PM General Q & A
    Replies: 1
    Last Post: 01-29-2006, 06:43 AM
  4. variables ?
    By BOINET jean luc in forum PM General Q & A
    Replies: 11
    Last Post: 01-24-2006, 04:00 PM