View Full Version : FSUIPC/MACRO/Keysend with sioc
Georg Schneider
05-04-2008, 11:01 AM
Hy guys !:D
With the new fsuipc 3.81 we have the option programming macros and
send key commands from second networked pc to activate functions
in FS.
I know how to create these macros and it works pretty good(pmdg)
I know how to setup wideserver.ini and wideclient.ini
like this:
wideserver.ini
[USER]
KeySend1=7
KeySend2=7,1
wideclient.ini
[USER]
Log=Errors+
ActionKeys=yes
KeySend1=145,17,run1
KeySend2=145,25,run1
run1=D:\programme\iocards\sioc\sioc.exe
but i cant find a a function in sioc to send a keystroke/combination
through widefs to my FS2004 PC
I`m sitting currently on my head and dont know how to proceed!?
Here is an excample from the pmdg script for the OC-MCP
Var 0060, name FDswitch, Link IOCARD_SW, Input 16
{
IF &FDswitch = 1
{
IF &FDLEFTled = 0
{
&keys = 56
&keys = 0
}
}
ELSE
{
IF &FDswitch = 0
{
IF &FDLEFTled = 1
{
&keys = 56
&keys = 0
}
}
}
}
this is the way sending keystrokes over sioc keyemulator to an open window.
How must i programm this to get it working with the fsuipc keysend
function?
I guess i`m just missing an command???
Any help is welcome:D
Greetings
Georg
Hi George,
Hy guys !:D
but i cant find a a function in sioc to send a keystroke/combination
through widefs to my FS2004 PC
That facility is present and you probably already are using it... ;-)
If you want to send something to FSUIPC from SIOC you need a Var linked to FSUIPC_OUT.
The rest is FSUIPC 'stuff', not SIOC:
The KeySend functions are available as what FSUIPC called FSControls.
Put the code of the control you want send to FSUIPC in offset 0x3110 with length 8 bytes (for most button types 4 will do). Read More about this in the "FSUIPC for Programmers.doc" of the FSUIPC SDK (available at Pete Dowson's website).
And also read FSUIPC for Advanced users.doc
So in SIOC this is quit easy, you only need:
Var 1 Link FSUIPC_OUT Offset $3110 Length 4 // command
and may be
Var2 Link FSUIPC-OUT Offset $3114 Length 4 // Param
The KeySend to WideFS control is 1006 (param = KeySend Number, 1-255)
Nico
Georg Schneider
05-04-2008, 03:30 PM
Hi Nico:D
I cant thank you enough for your kind help:D
I dont know what to do without your help!
Thanks very much now i have the glue and can manage to get my OC-MCP rocking with the new fsuipc macro function;)
I was reading all the fsuipc/widefs manuals but clearly oversee something;)
BTW have you seen my tutorial for OC-MCP/EFIS and OGS1.20?
This came to life as you last helped me working these things out.
I like to do tutorials writing and helping others when i ged the glue out of something:cool:
Greetings and happy flying
George
Georg Schneider
05-04-2008, 04:31 PM
;)Hi Nico one question i still have:D
The KeySend to WideFS control is 1006 (param = KeySend Number, 1-255)
Nico
Is the code above to send a keystroke used like this? Am i right?
This code should send key "1" over wideclient to fsuipc to activate FDswitch when key "1" is assigned in wideserver.ini say as "CTRL+M"
Var 0001, name sendkey, Link FSUIPC-IN Offset $1006 Length 4 //Param
Var 0060, name FDswitch, Link IOCARD_SW, Input 16
{
IF &FDswitch = 1
{
IF &FDLEFTled = 0
{
&sendkey = 1
&sendkey = 0
}
}
ELSE
{
IF &FDswitch = 0
{
IF &FDLEFTled = 1
{
&sendkey = 1
&sendkey = 0
}
}
}
}
Sorry vor asking so much and taking your time!;)
Greetings George
No it's totally wrong... ;-)
You have to put 1 in my Var 2 linked to FSUIPC offset 0x3114 first, and then put 1006 in Var 1 linked to FSUIPC offset 0x3110 ...
Note that offset 0x3110 is a offset in which you can put any FSControl.
For another example of this principle, incrementing and decrementing the QNH with FSControls, look at this code:
http://www.lekseecon.nl/howto.html#QNH
You see, also in this example offset 3110 is used.
I have not used FSControls with a parameter myself, so that part is something you have to experiment a little, but I guess you just put the parameter in first and then the FSControl (that will 'fire' FSUIPC to issue the command)
Viel Spass!
Nico
Georg Schneider
05-04-2008, 05:22 PM
Hi again;)
I guess it is late and i lost the cabel:neutral:
Do you mean it like this?
Var 1 Link FSUIPC_OUT Offset $3110 Length 1006 // command
Var2 Link FSUIPC-OUT Offset $3114 Length 1 // Param
I think i`m wrong again and maybe start over tomorrow again with reeding;)
Greetings and thanks very much George
No, like this:
Var 3 Value 0
{
v2 = 1 // parameter for the FSControl
v1 = 1006 // FSControl KeYsend
}
Var 1 Link FSUIPC_OUT Offset $3110 Length 4 // command
Var 2 Link FSUIPC_OUT Offset $3114 Length 4 // Param
Nico
Georg Schneider
05-05-2008, 06:41 AM
Hi Nico !
After 1 night of sleep i hope i got the point....:)
Here my excample FDswitch:
Var 0001, name keysend , Link FSUIPC_OUT Offset $3110 Length 4
Var 0002, name key , Link FSUIPC_OUT Offset $3114 Length 4
// __________________________________________________________________
// Entradas IOCARD Interruptores & bp (button press)
//___________________________________________________________________
Var 0060, name FDswitch, Link IOCARD_SW, Input 16
{
IF &FDswitch = 1
{
IF &FDLEFTled = 0
{
&key = 1 // parameter for the FSControl
&keysend = 1006 // FSControl KeYsend
}
}
ELSE
{
IF &FDswitch = 0
{
IF &FDLEFTled = 1
{
&key = 1 // parameter for the FSControl
&keysend = 1006 // FSControl KeYsend
}
}
}
}
Greetings George:rolleyes:
warvet
05-05-2008, 06:55 AM
Wow :) I got totally lost after the first Var 1= Soic Fsuipc $# -= WAAAAAAAAA :) glad Im not doing this programming :)
Tim
A340
Hi,
You are getting 'warm' indeed ;-)
After you send the 1006 to Var 1 you have to 'clear' the value of Var 1, otherwise SIOC will not detect a second 1006 value, I always do that with a small delay:
&keysend = 1006 // FSControl KeYsend
&keysend = DELAY 0 10
and finally, Tip: I would rename vars 1 and 2
Var 0001, name keysend , Link FSUIPC_OUT Offset $3110 Length 4
Var 0002, name key , Link FSUIPC_OUT Offset $3114 Length 4
into
Var 0001, name FSControl , Link FSUIPC_OUT Offset $3110 Length 4
Var 0002, name Parameter , Link FSUIPC_OUT Offset $3114 Length 4
Reason: KeySend is just one of the possible controls you can pass to 3110 ...
Nico
Wow :) I got totally lost after the first Var 1= Soic Fsuipc $# -= WAAAAAAAAA :) glad Im not doing this programming :)
Tim
A340
Hi,
Well, you are never too old to learn: http://www.lekseecon.nl/howto.html
:-)
Nico
Georg Schneider
05-05-2008, 11:13 AM
Hi Nico !:D
Juhuuuuu!!!!!! I finaly got it right:cool:
I will rename the names like you sayd Nico! Thats easyer to understand.
And the statemant "You are never too old to learn" is true:wink:
As i was a child my father told me something that i can only write in German:
I guess Nico you understand this German phrase!?:D
"Nur wer nicht fragt bleibt blöd":cool:
Sometime with all the reading and trying your head is too full
to understand something at first time......
And for me i`m the mechanic guy and the hardwareman;-)
And programming wise i need a bit longer to get the point!
So when anybody needs help with mechanics PC-Hardware
Networksettings and so on he can ask me:smile: And i try my best to help!
Thanks very much Nico for your kind help!
"Dankeschön"
Greetings
Georg
Hallo der George,
I guess Nico you understand this German phrase!?:D
"Nur wer nicht fragt bleibt blöd":cool:
Jawohl, ich kan die Deutche Sprache gut lezen und verstehen. Kein problem. Gut sprechen ist etwas schwieriger. Auf English geht's besser.
Auf Wiederhören,
Nico