Greetings Pete,
I hope this is the correct area of your forum to ask this. My head has been spinning the last few weeks trying to search for the answer (I'm seriously lacking in programming knowledge), with no luck so far... and I figured you would know the answer. I have an Opencockpits Mastercard, which I'm sure you know deals with SIOC. I've been able to figure out how to get a simple command of, say the parking brake, to connect to one of my Korry switches. The bottom LED is on when the switch is off (brakes off) and when the switch is in/on the top LED turns on. That's all well and fine, as there is the FSUIPC_INOUT, Offset $0BC8, Length 2... portion of the coding. Where I have an issue with is getting commands from LUA into that type of code. As an example, the LINDA software offers about 90% of the switch actions for the Majestic Simulations Q400. Using my Korry switch which is for the Left Engine Intake door with a Leo-Bodnar card as a joystick, I can set the switch to that door as either Open or Closed, but the LEDs don't work.. hence me doing it with SIOC. The only thing is that I can't figure out where or how to get the information from LINDA into SIOC.
Here's the LUA lines from LINDA regarding the door, and also the SIOC I used for the parking brake, which you can see I put the offset in bold, if that helps... If you can help, it would be greatly appreciated! -Thanks, Jack
function ICE_EngIntake_L_open ()
ipc.writeLvar("MJC_VAR_WRITE_VALUE", 1)
ipc.writeLvar("MJC_VAR_WRITE_CODE", 70232)
DspShow ("IntL", "open")
end
function ICE_EngIntake_L_close ()
ipc.writeLvar("MJC_VAR_WRITE_VALUE", 0)
ipc.writeLvar("MJC_VAR_WRITE_CODE", 70232)
DspShow ("IntL", "clse")
end
Var 0400, Value 0 // Inicialización / Var init
Var 0001, Link FSUIPC_INOUT, Offset $0BC8, Length 2 //
Var 0002, Link IOCARD_SW, Input 2 Type I //
{
IF V0002 = 1
{
V0001 = 32767
V0003 = 0
V0004 = DELAY 1 700
}
ELSE
{
V0001 = 0
V0003 = DELAY 1 700
V0004 = 0
}
}
Var 0003, Link IOCARD_OUT, Output 11
Var 0004, Link IOCARD_OUT, Output 12