One_shot
10-15-2015, 02:13 PM
Hey Nico,
I've tried reading through a bunch of threads, even contacted Pete Dowson (FSUIPC), a few guys at LINDA... and none of them could help. I'm hoping that you can, since you seem to be the SIOC master (I probably should have come here first).
I'm really a n00b when it comes to programming, although I think I'm sort of getting the hang of it at least a little. I've been able to take a simple code and make my Korry switch light up (see further down for the code... which I'll get to again). Where I have the problem though, is writing variables to SIOC that FSX can read and use to control what's in the cockpit... not even sure I'm asking that right.
Let me start by saying, I'm trying to build a Q400 cockpit based off the Majestic Simulations Q400. (You can see my panels at https://www.facebook.com/FlyaDash). I can run the basic FSUIPC offsets that the default aircraft use, but the Q400 uses variables, like the following:
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
What I'm trying to do is figure out how I can get that information into SIOC, so that my Korry switch will function correctly. Granted, I could just use LINDA, which has the switch already written, but then I can't make my LEDs in the Korry switch work. If I do something basic like the Parking Brake, the Korry switch works as it should (like in this example):
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
The main problem is that most of the cockpit, while in LINDA, doesn't use offsets like in my example above. Is there any possible way you could help me? Hopefully? If I can get at least the two Korry switches for the Engine Intake doors to work, I can then move on to the rest of my overhead, making sure it's all coded the proper way... but these switches are basic (at least in tests... there's really more to it, depending on if the battery is on, and either the ground power is connected or APU is on), with the korry being off/out - the bottom "CLOSED" LED is on, and when the korry is on/in the top "OPN" LED is on, like in the picture... but how can I get that to work with SIOC so that it interacts with the sim?
Best Regards,
Jack
http://www.mycockpit.org/forums/attachment.php?attachmentid=10837&stc=1
I've tried reading through a bunch of threads, even contacted Pete Dowson (FSUIPC), a few guys at LINDA... and none of them could help. I'm hoping that you can, since you seem to be the SIOC master (I probably should have come here first).
I'm really a n00b when it comes to programming, although I think I'm sort of getting the hang of it at least a little. I've been able to take a simple code and make my Korry switch light up (see further down for the code... which I'll get to again). Where I have the problem though, is writing variables to SIOC that FSX can read and use to control what's in the cockpit... not even sure I'm asking that right.
Let me start by saying, I'm trying to build a Q400 cockpit based off the Majestic Simulations Q400. (You can see my panels at https://www.facebook.com/FlyaDash). I can run the basic FSUIPC offsets that the default aircraft use, but the Q400 uses variables, like the following:
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
What I'm trying to do is figure out how I can get that information into SIOC, so that my Korry switch will function correctly. Granted, I could just use LINDA, which has the switch already written, but then I can't make my LEDs in the Korry switch work. If I do something basic like the Parking Brake, the Korry switch works as it should (like in this example):
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
The main problem is that most of the cockpit, while in LINDA, doesn't use offsets like in my example above. Is there any possible way you could help me? Hopefully? If I can get at least the two Korry switches for the Engine Intake doors to work, I can then move on to the rest of my overhead, making sure it's all coded the proper way... but these switches are basic (at least in tests... there's really more to it, depending on if the battery is on, and either the ground power is connected or APU is on), with the korry being off/out - the bottom "CLOSED" LED is on, and when the korry is on/in the top "OPN" LED is on, like in the picture... but how can I get that to work with SIOC so that it interacts with the sim?
Best Regards,
Jack
http://www.mycockpit.org/forums/attachment.php?attachmentid=10837&stc=1