PDA

View Full Version : Using SIOC variables



MortenHa
12-08-2008, 07:15 PM
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:o
Morten

kiek
12-08-2008, 07:30 PM
This is a declaration statement(?):
Refer to it this way(?): V302
or
by its name(?): RecallSwitch

yes, although one should write &RecallSwitch




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.



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

Yes.



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)



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 (http://www.lekseecon.nl/howto.html)

Kennair
12-08-2008, 09:23 PM
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.

MortenHa
12-09-2008, 02:14 AM
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:p.

I'm slowly getting a feel for the language:p

kiek
12-09-2008, 03:16 AM
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