View Full Version : Help with SIOC please?
Jake 747 400
11-19-2009, 03:20 PM
Hey everyone.
I have been reading tutorials on SIOC and have wrote a small test program on it just for one push button.
But I dont know how to get SIOC to load the file, everytime it comes on it loads the default program file but I dont know how to make it load my own.
I have tried loading the file on Config_SIOC but SIOC exe still does does not load the file.
Can someone point me in the right direction please, maybe this is somthing simple.
Thanks,
Jake.
Peter_Pilot
11-19-2009, 03:39 PM
Hello Jake,
have you tried editing sioc.ini to call up your *.ssi file instead of the default ssi file?
Jake 747 400
11-19-2009, 03:41 PM
Hey, thanks for the reply.
I havent tried that, but i will no you have mentioned it.
Im not sure how to do that but ill try,
Thanks again.
Jake.
Jake 747 400
11-19-2009, 03:44 PM
Is SIOC.ini another prgram because in a tutorial I saw that mentioned being another program.
belgianguy
11-19-2009, 03:44 PM
Hello Jake,
It is very simple.
First you create your script and save it in a .txt file. (example: my_script.txt)
Save it in the sioc directory.
Then you need to edit the sioc.ini file.
There you will find this line:
CONFIG_FILE=.\sioc.ssi
The sioc.ssi file is the default file that will load when you start sioc.exe
Now change this line to this:
CONFIG_FILE=.\my_script.txt
Save the file and start sioc.exe and you can test your script.
Sioc.exe will create a new file (my_script.ssi) so you don't have to convert it yourself.
You can also save your file in another directory but then you need to specify the complete directory structure where sioc can find your file.
Sioc.ini is not another program. It is the initialisation file for sioc.exe.
Gert.
Jake 747 400
11-19-2009, 03:46 PM
Ahhh I see, thankyou very much.
Thats a big help.
Thanks,
Jake.
Jake 747 400
11-19-2009, 03:47 PM
Hello Jake,
have you tried editing sioc.ini to call up your *.ssi file instead of the default ssi file?
Thanks for your help.
Jake.
Jake 747 400
11-19-2009, 03:54 PM
Success!! Thanks guys I can move on with trials now.
Regards,
Jake.
Peter_Pilot
11-19-2009, 04:01 PM
Thanks for your help.
Jake.
It is my pleasure to hear that you are making progress.
Peter.
Jake 747 400
11-19-2009, 04:18 PM
Thankyou, just out of thought.
I have got a button to make the speed selector on the mcp work, so say if I wanted a toggle switch to flick on the A/T does that need a new file or can I just start a new line of program under the first one for the speed selector?
Thanks again,
Jake.
belgianguy
11-19-2009, 05:10 PM
Thankyou, just out of thought.
I have got a button to make the speed selector on the mcp work, so say if I wanted a toggle switch to flick on the A/T does that need a new file or can I just start a new line of program under the first one for the speed selector?
Thanks again,
Jake.
Yes, you can continue in the same file. Just start a new line of code.
Best thing to do is divide your complete list of code in sections so you can always find a certain section in case of trouble. Just add some comment in your code. At this moment you don't need it because it's still a small program but if you start programming your complete cockpit, then there will be lot more lines of code and it will be difficult to find something.
You can add comment in your code this way:
// here you can put comment.
So you start with two slashes a space and then your comment.
Don't forget the space after the two slashes or your program will not run.
Gert.
Peter_Pilot
11-19-2009, 05:11 PM
Hello Jake,
A new section of code in the same file should do the trick.
I am not an expert by the way, I am trying to learn SIOC myself.
Good luck,
Peter.
Jake 747 400
11-19-2009, 06:35 PM
Thanks again to both of you.
For my sim Im using PMDG 747-400 thats the only thing I can use until PSX.
But as you know PMDG is hard to interface, but I learned the other day that using mouse macro switches can be assigned to the key board. It worked for me, but I wanted a real switch to work with pmdg so thats why I set out with SIOC.
just after you guys told me how to set up SIOC I got a push button to make the speed selector come on, on pmdg. This is the code for it:
Bearing in mind the button is in input 27 on my master I/O card.
Var 1 Link IOCARD_SW Input 027 Type I
{
&FO_JoyStick64 = CHANGEBIT 0 v1 // toggle bit 0 of joystick 64
}
Var 2 name FO_JoyStick64 Link FSUIPC_OUT Offset $3340 Length 4
Basically when I push the button it tells FSUIPC that bit 0 of a virtual joystick has been pushed or changed etc, so when I go on FSUIPC I can push the button, it will recognise it and then I can set that button to send the key action that switches on the speed selector,,, I think hahah.
Sooo then I wanted a switch to turn on the A/T this was the hardest part for me, I had some help on how to rite the previous code form tutorials etc, but now i had to think it out myself. So I put a 2 terminal toggle switch (SPST) in input 001 of the master card and wrote the following code under the other one:
Var 3 Link IOCARD_SW Input 001 Type I
{
&CO_JoyStick64 = CHANGEBIT 1 v3 // toggle bit 1 of joystick 64
}
Var 4 name CO_JoyStick64 Link FSUIPC_OUT Offset $3340 Length 4
This "sort" of worked, meaning that I had to switch the switch on then off then back on again for it to turn back off the A/T, this totally confused me and took me about an hour to figure lol. I tried many ways to fix this but eventually I realised to try a 3 terminal switch (DPDT), but I did not know how to write the code for this so I sat an puzzled, and then it came to me.
To make the DPDT switch work obviously I need to inouts and the common ground, so I used input 001 and 002. I thought If i could get input 001 to toggle bit 1 of joystick 64 to turn on the A/T then I could get input 002 to toggle bit 1 of joystick 64 also, so this ment either way I switched it, bit 1 is being toggled (thats what DPDT's are for anyway haha) so now I flick the switch and it turms on the A/T and flick it again and it turns of the A/T success!!! Heres the program for it all including the speed selector at the beggining:
Var 1 Link IOCARD_SW Input 027 Type I
{
&FO_JoyStick64 = CHANGEBIT 0 v1 // toggle bit 0 of joystick 64
}
Var 2 name FO_JoyStick64 Link FSUIPC_OUT Offset $3340 Length 4
Var 3 Link IOCARD_SW Input 001 Type I
{
&CO_JoyStick64 = CHANGEBIT 1 v3 // toggle bit 1 of joystick 64
}
Var 4 name CO_JoyStick64 Link FSUIPC_OUT Offset $3340 Length 4
Var 5 Link IOCARD_SW Input 002 Type I
{
&DO_JoyStick64 = CHANGEBIT 1 v5 // toggle bit 1 of joystick64
}
Var 6 name DO_JoyStick64 Link FSUIPC_OUT Offset $3340 Length 4
I know most of you know how to do this, but for anyother builders who dont, I hope this helps, kind of hard to explain but i tried to simplify it as much as possible.
Regards and thanks again,
Jake.
Oh, and btw the reason for the, FO_JoyStick, CO_JoyStick and DO_JoyStick having FO,CO and DO is just because it would not let me have them all called FO which make sense cause they cant all be the same thing.
deering
11-20-2009, 07:00 PM
Hello, Jake.
Not sure it's good etiquette for me to jump in here; but, too late now, so here are my comments.
.... using mouse macro switches can be assigned to the key board....
I assume you're talking about FSUIPC mouse macros. If that's the case, you don't need to assign the operation to a keystroke. Save some cycles and assign the macro directly to the virtual pushbutton - selecting it from the list of FS Controls.
Var 1 Link IOCARD_SW Input 027 Type I
{
&FO_JoyStick64 = CHANGEBIT 0 v1 // toggle bit 0 of joystick 64
}
Var 2 name FO_JoyStick64 Link FSUIPC_OUT Offset $3340 Length 4
Again, save some cycles. You're using a pushbutton; define it as "Type P" , for pushbutton, and "TOGGLE" the virtual button:
Var 1 Link IOCARD_SW Input 027 Type P
{
&FO_JoyStick64 = TOGGLE 0 // toggle bit 0 of joystick 64
}
.
.
This "sort" of worked, meaning that I had to switch the switch on then off then back on again for it to turn back off the A/T ....
.
.
Look at the FSUIPC Options and Settings page for Buttons + Switches.
You can perform one operation when the button is pressed and another (or repeat the same one) when the button is released. Use your SPST and one Master Card input and map its on-off action to your FSUIPC on-off operations. Again, if you're using mouse macros, no need to use up keystrokes.
The SIOC script becomes:
-----------------------------------------------------------------
Var 1 Link IOCARD_SW Input 027 Type P
{
&JoyStick64 = TOGGLE 0 // toggle bit 0 of Joystick 64
}
Var 2 Link IOCARD_SW Input 001 Type I
{
&JoyStick64 = CHANGEBIT 1 V2 // set/reset bit 1 of Joystick 64
}
Var 10 name JoyStick64 Link FSUIPC_OUT Offset $3340 Length 4
-----------------------------------------------------------------
.
Var 4 name CO_JoyStick64 Link FSUIPC_OUT Offset $3340 Length 4
.
Var 6 name DO_JoyStick64 Link FSUIPC_OUT Offset $3340 Length 4
These were redundant. Define one variabe for the offset and use that throughout your script.
Jim