Está en la página 1de 10

So what is FSUIPC and these Offset thingys ?

So you've got no programming skills and you've only just discovered that your PC has a calculator...
but you're not stupid.. after all you went to school, you know how an engine works and heck you
even know how a jet engine works, roughly !
ut as you start to read all of the documentation that you've found on the net for !light sim and
"nterfacing, it all starts to blur and sound like the most complicated thing on the planet # ever.
$memory % offsets) &
$floating point ' axis) & config files =
(((((((((((((((((((((((((
button assignments
eventually it all starts looking like )mem #^:,floating*%:, offset @:] blah blah blah !!
So "'ll stop you there.. and try to clear a few things up.
In the beginning...
So you've heard of FSUIPC and people keep on mentioning 'offsets', but what are they and what
do you need to know about them *
!S+"PC is a utility developed by Pete ,owson and originally created by -dam S.ofran in the form of
!S/"PC. "n simple terms !S+"PC allows e'ternal applications to access many of the 0icrosoft !light
Simulator internal variables from simple data like pitch, roll, altitude and heading right through to
weather and acceleration values.
In a Nutshell
1he !S+"PC module reserves a /2232 byte block of memory and
then populates part of this memory with various pieces of data
e'tracted from !S. 4'ternal applications
then have read and write access to the
data in this block of memory for their
own use.
5ou need to know about offsets and
memory if you are going to be
interfacing with !light Sim via your only application or maybe via
some "67 interfacing software or perhaps you want to start
enhancing your sim setup by adding a few e'tra buttons.
1
A flat pack Offset is bo!n
)4ach piece of !S data is placed in the memory block at a certain location. 1his is it's 'offset'.8
5ou can think of the memory block as a huge empty shelf.
...... -nd this shelf is divided into /2232 compartments.
................-nd each compartment represents a single byte.
!S+"PC then takes individual pieces of flight sim data and places then in separate compartments in
the memory block.
So put in simple language it's like saying 9
)"'ve put the landing light data in compartment 428
"f you wanted to read the landing light data you would read the value in
compartment 42.
7ffsets are usually specified in :e' format 9
byte 42 in decimal ; 7ffset 002A in :e'
<ritten down in a table it might look like this9
Description Offset Size
=anding =ights >>?- @
4ngine 7il 1emp >>? ?
-irspeed >>?, A
-ltitude >>3@ B
-nd this is how the memory block would look.
yte A> A@ A?.....
> > > @ @C? > > > > > > > > > > > > > > > > > > >

=nd =ights
4ng 7il 1emp
-irspeed -ltitude
2
!or those wanting to read the values from the memory block, you would normally want to read the
data into the same si.ed variable as it was initially written.
y this " mean that you would read an B byte altitude value into an internal variable defined as B
bytes. 7therwise you will not have all of the data bytes need to correctly format the value, and the
value that you read will be incorrect.
1he bottom line is 9
!S+"PC stores data from !light Simulator in a memory block.
4ach piece of data is assign a number of bytes depending on the si.e of the value that
needs to be stored.
1he starting location of the data is noted and known as it's 'offset' in the memory block.
1his memory block is then made available to e'ternal applications. <ideClient also sends a copy of
this memory block across your network to other client pc's.
"hich Offsets can I use ?
-ll of the memory values that are e'tracted from !light Sim and populated by !S+"PC are listed in
the !S+"PC S,D.
1he usage of each offset is clearly stated in the documentation.
Some !S+"PC offsets are 'read only' and cannot be written to.
Some offsets can be written to but not intended for this purpose and your data will be
overwritten during the ne't !S+"PC data load.
Some offsets are read6write and you can write a value to these offsets to modify a function
in !S.

1herefore you should only used the offsets
publisged in the !S+"PC S,D as documented or you
might get some une'pected results.
7thwise you can use virtually any spare offset in
the range.
But Remember.....
"f your application writes data to an offset that is
already being populated by !S+"PC or one of your
other !S addons it will probably get overwritten.
3
#ow $any offsets do I !e%ui!e ?
"f you are reading values from !S+"PC then you will need to reference the documentation for the
product that is populating that offset to understand how many bytes to read.
"f you want to use !S+"PC to store your own value you will need to decide how many bytes it
reEuires.
Ask yourself - Do I need to store...
a large number, negative number or floating point 'decimal' number !
"or info#
1 byte can store a number bet$een % and &'' (t)is could also be an ascii c)ar*
2 bytes (kno$n as a +,RD or -.A//I01* can store a number bet$een %-2''3' unsigned
or -3&424 5 3&424 signed
4 bytes (kno$n as a D+,RD or I01676R or "/,A13& or -I07/6 depending on t)e usage*
can store a $)ole number bet$een %-8&98924&92 or decimal values
8 bytes (kno$n as a "/,A128 or D,:B/6* can )old large decimal values.
If you need to store a string c)aracter t)is is )eld as it's A-;II c)aracter code %-&'',
t)erefore a single c)aracter is stored in a byte.
4
Si$&A'ionics Specific Info!$ation
-s a base for Sim&-vionics offsets " usually recommend starting with the 23>>&23!! range. 1hese
?22 bytes have been 'reserved' in !S+"PC for this project and no other official application should
be using them. & But it doesn't really matter $)ic) offsets you use as long as t)ere are no conflicts.
0ost current interface solutions are able to read6write with !S+"PC, so a typical setup to map a
battery switch might be9
Step @9 Press a button in your sim
Step ?9 1his is detected by your "67 card and it's software writes a '@' to a specified offset.
Step 39 "n the Sim&-vionics !S+"PC("7.ini file you have assigned the specified offset to the
attery Switch.
Step A9 1he Server reads the specified offset and enables the attery Switch.
Assigning Switch Inputs
1here are ? methods of using !S+"PC to control system switches in the server.
1he first is the Direct Offset method. 0eaning each function monitors a specific offset.
1o assign the offsets to the -114F5 switch and
-,"F+ switch you must edit the !S+"PC("7.ini
1his tells the server to monitor offsets 23?> and 23?@ for the attery and -,"F+ switch positions.
- value of > ; Switch 7!! and @ ; Switch 7G.
1he second method is via a MultiFunction Offset this is also assigned in the !S+"PC("7.ini.
1his time instead of assigning a different offset for
every function you just assign the 0ulti!unction offset.
$? byte <7F,H
1he server then monitors this offset and functions are trigger depending on the value set at this
offset.
704 ; -114F5 S<"1C: ; 7!!
705 ; -114F5 S<"1C: ; 7G
722 ; -,"F+ S<"1C: ; 7!!
723 ; -,"F+ S<"1C: ; 7G
7nce the function has been trigger the server sets the 0ulti!unction offset back to a value of >
ready for the ne't command.
A full .ulti-"unction list can be found in our :ser .anual
5
I!S+"PC("GP+1SJ
-114F5(S<"1C:;23?>
-,"F+(S<"1C:;23?@
I!S+"PC(0+=1"(!+GC1"7GJ
0+=1"(!+GC1"7G;23!4
Assigning Outputs
Kust like the switch inputs an !S+"PC offset can be assigned to an output function.
1his is again made in the !S+"PC("7.ini file.
-fter the !S+"PC("GP+1 section there is an !S+"PC(7+1P+1 section. -nd it's here you can assign
an offset to a function.
<lease note# at t)is stage t)e output value represents t)e status of assigned system and not t)e
over)ead lig)t state. 1o clarify, on an aircraft over)ead, a lig)t usually illuminates $)en a system is
inoperative or t)ere is a failure.
"n this e'ample offset 23C> will ; @ when the battery
system is 7G and ; > when the battery system is 7!!.
1his is likely to be the opposite of what you want your battery 'light' to do on
your overhead panel.
1herefore you can either allow for this in the code for your interface solution or use some of the
additional assignment options in the !S+"PC("7.ini file.
66 "tem ; offset Linvert $@ or >H b$bit >&CH
66 -114F5;23C> $if attery ; 7G then offset 23C> ; @H
66 -114F5;23C>L@ $if attery ; 7!! then offset 23C> ; @H
66 -114F5;23C>b? $if attery ; 7G then offset 23C> ; AH $bit ?H
66 -114F5;23C>b>>>>>@>> $if attery ; 7G then offset 23C> ; AH $bit ?H
66 -114F5;23C>L@b3 $if attery ; 7!! then offset 23C> ; BH $bit 3H
66 -114F5;23C>L@b>>>>@>>> $if attery ; 7!! then offset 23C> ; BH $bit 3H
1his would invert the offset value. Gow 23C> will ; >
when the battery system is 7G and ; @ when the
battery system is 7!!.
"n your interface solution you can now say something like 9
if 23C> ; @
attery(=ight ; 7G
else
attery(=ight ; 7!!
Don't <anic=
6
I!S+"PC(7+1P+1SJ
-114F5;23C>
I!S+"PC(7+1P+1SJ
-114F5;23C>!
Using Offset & (bits)
- '"1' is a single number or a 'virtual' switch. "t can either be 7!! ; 0 or 7G ; !
- '514' contains B bits 00000000
"n normal decimal notation we count in @>'s. 4ach column is a multiple of @> and each digit can by
>&M -s a number gets more .eros added to it we multiply by @>, so... 7ne, 1en, 7ne :undred, 7ne
1housand etc
inary work slightly different as a bit can only have a value of > or @.
-s a bit moves left in the 'byte' it's value doubles, then just like in decimal you add up all of the
'7G' bits to calculate it's decimal value.
"#lue !2$ %4 32 !% $ 4 2 !
0 > > > > > > > >
! > > > > > > > !
2 > > > > > > ! >
3 > > > > > > ! !
!3 > > > > ! ! > !
75 > ! > > ! > ! !
255 ! ! ! ! ! ! ! !
so what does this $ean ?
- single byte or fsuipc offset can hold a value of >&?22, so if you want to hold a value like a battery
voltage >&?Av you would need to use the whole byte to store this value, but if you want to hold
basic 7G67!! states for switches you 'can' assign each of the B 'bits' separately.
1he result is e'actly the same as assigning a whole byte to a function.
-n advantage is that you reEuire less offsets.
1o assign an offset bit to a function you use the additional assignment option &'&(
'bits' are numbered from right to left 0)7
1his e'ample will set the battery switch when bit > ; @
and the -,"F+ switch when bit A ; @
1his is how the offset value will look as the two switches are changed9
oth 7!! 00000000 ; > in decimal
attery 7G 0000000! ; @ in decimal
-,"F+ 7G 000!0000 ; @/ in decimal
oth 7G 000!000! ; @C in decimal
7
I!S+"PC("GP+1J
-114F5(S<"1C:;23?>b>
-,"F+(S<"1C:;23?>bA
In Su$$a!y
Direct Offset Met*o+ MultiFunction Met*o+
I,O Co+e
FSUIPC-IO(ini
FSUIPC-IO(I.I
I,O Co+e
8
I!S+"PC("GP+1SJ
-114F5(S<"1C:;23?>
-,"F+(S<"1C:;23?@
I!S+"PC(0+=1"(!+GC1"7GJ
0+=1"(!+GC1"7G;23!4
7n Switch Change
"f "67 Switch @ ; 7G $-114F5H
Set 7ffset 23?> ; @
else
Set 7ffset 23?> ; >
"f "67 Switch ? ; 7G $-,"F+H
Set 7ffset 23?@ ; @
else
Set 7ffset 23?@ ; >
7n Switch Change
"f "67 Switch @ ; 7G $-114F5H
Set 7ffset 23!4 ; C>2
else
Set 7ffset 23!4 ; C>A
"f "67 Switch ? ; 7G $-,"F+H
Set 7ffset 23!4 ; C?3
else
Set 7ffset 23!4 ; C??
Sim&-vionics Server
I!S+"PC(7+1P+1SJ
-114F5(S<"1C:;23C>
-,"F+(S<"1C:;23C@
"f 7ffset 23C> ; @ $-114F5H
Set "67 =ight @ ; 7!!
else
Set "67 =ight @ ; 7G
"f 7ffset 23C@ ; @ $-,"F+H
Set "67 =ight ? ; 7!!
else
Set "67 =ight ? ; 7G
Using FSUIPC within FS to assign offset 'alues to a *oystick +utton
"f you have dedicated hardware controller software like "nterface"1 from !,S or S"7C then you will
assign functions from their own software. ut if you have an interface that emulates joystick
buttons or want to assign you current joystick buttons to functions then you can use the uttons %
Switches utility within the !S+"PC module.
1o do this9
Start !S and under the 0odules menu select !S+"PC.
1hen select the )uttons % Switches8 tab.
Ge't 'press' the Koystick button you wish to assign to a function.
!S+"PC should detect the button press and display the KoyN and tnN in the window.
"n this e'ample " have pressed button ? on the joystick >.
5ou then need to fill in the details on the right hand side to assign an offset and value to the
joystick button.
9
1o do this select the )Select fo !S control8 checkbo'.
/o #ssi0n # MultiFunction Offset 1
"n the )Control sent when button pressed8 bo' select )Offset 2or+ Set8
from the drop down list.
/o #ssi0n # Direct Input Offset 1
"n the )Control sent when button pressed8 bo' select )Offset 34te Set8
from the drop down list.
1hen in the )7ffset8 bo' enter the offset that you wish to update.
1his could be the ,irect or 0ulti!unction offset.
Ge't in the )Parameter8 bo' enter the value you want the offset to have.
!or a ,irect "nput offset this will usually be !. !or the 0ulti!unction offset this will be the function
value found on the multifuction list in the +ser 0anual.
"! you want something to happen when you release the button then you can also fill in the
)Control sent when button released8 fields.
by Mark Hastings 2009
10

También podría gustarte