SIOC Everything looks good, BUT.....
not working in FSX.
I have been struggling to learn SIOC. So I pulled the IO Master card and USB card from my cockpit and built a test setup. I have a panel with a series of switches, push buttons, encoder, and axes pot. My goal is to slowly learn to write to each item.
Today I spent hours writing simple code (shown below) to three toggle switches. A master avionics switch, battery switch and generator switch. The txt was complied with no problem by SIOC into a ssi file, which loads fine. The switches show and work in the controller panel. However, not in the game. Nothing, nada. I even changed the offest on the first switch to $0280 (Lights) and couldn't get it to work.
Any ideas?
Code:
Var 0005, name masterSW, Link FSUIPC_OUT, Offset $2E80, Length 4 // Master switch
Var 0006, Link IOCARD_SW, Input 000 Type I // Master switch
{
IF V0006 = 1 // If the switch is on
{
V0005 = SETBIT 2 // Set Bit 2
V0007 = 1 // Turn on the LED
}
ELSE // If the switch is off
{
V0005 = CLEARBIT 2
V0007 = 0 // Turn off the led
}
}
Var 0007, Link IOCARD_OUT, Output 38 // Led Not currently set up ck output #
Var 0008, name batterySW, Link FSUIPC_OUT, Offset $281C, Length 4 // Battery switch
Var 0009, Link IOCARD_SW, Input 001 Type I // Battery switch
{
IF V0009 = 1 // If the switch is on
{
V0008 = SETBIT 2 // Set Bit 2
V0010 = 1 // Turn on the LED
}
ELSE // If the switch is off
{
V0008 = CLEARBIT 2
V0010 = 0 // Turn off the led
}
}
Var 0010, Link IOCARD_OUT, Output 39 // Led Not currently set up ck output #
Var 0011, name GenSW, Link FSUIPC_OUT, Offset $3B78, Length 4 // Generator switch
Var 0012, name Generator Link IOCARD_SW, Input 002 Type I // Generator
{
IF &Generator = 1 // If the switch is on
{
&GenSW = SETBIT 2 // Set Bit 2
V0013 = 1 // Turn on the LED
}
ELSE // If the switch is off
{
&GenSW = CLEARBIT 2
V0013 = 0 // Turn off the led
}
}
Var 0013, Link IOCARD_OUT, Output 40 // Led Not currently set up ck output #
.... it all looks well, but.
Hei,
I did not meen to make you confused.
Stamdard code was not the right word, what I ment was: start with basic code and implement the setbit, clearbit functions later. They can be tricky!
Now it looks like it's well explained above.
Good luck.
Nils