Log in

View Full Version : Emulate switch with momentary button?



CoNa
07-04-2008, 06:41 PM
Following up my default FSX SIOC config with a new thread.

I'm trying to emulate a toggle switch (the GPS/NAV) with a momentary button on my OC MCP (VNAV button).

So far I have managed to switch it, but as the button is momentary
the switch goes back to previous state when I release the button.

Is there away to make this working?
This is the setup I have come up with so far.

Var 0032, Link FSUIPC_INOUT, Offset $132C, Length 4 // AP_VNAV emulate NAV/GPS Switch
{
IF V0032 <> 1
{
&O_VNAV = 1
}
ELSE
{
&O_VNAV = 0
}
}

Var 0090, name O_VNAV, Link IOCARD_OUT, Output 25

Var 0154, name I_VNAV, Link IOCARD_SW, Input 30
{
IF &I_VNAV <> 1
{
V0032 = 1
}
ELSE
{
V0032 = 0
}
}

I have an idea that I can possibly use 2 buttons , VNAV and LNAV that are note used in the default FSX 737 anyway.

Could that be a solution?

jeehell
07-04-2008, 07:08 PM
Edited: I have a problem of dyslexia when it comes to your variables I think :), this should work:



Var 0032, name SWITCH Link FSUIPC_INOUT, Offset $132C, Length 4 // AP_VNAV emulate NAV/GPS Switch
{
$O_VNAV=$SWITCH
}



Var 0090, name O_VNAV, Link IOCARD_OUT, Output 25


Var 0154, name I_VNAV, Link IOCARD_SW, Input 30
{
IF $SWITCH = 0
{
$SWITCH = 1

}
ELSE
{
&SWITCH = 0

}
}

CoNa
07-04-2008, 07:48 PM
Thanks, but something is wrong with it. Sioc_config won't let it pass.

$O_VNAV=$SWITCH

Should it be &O_VNAV=$SWITCH ?

Just bit confused, but it's getting too late here.... 02:00 in the night
Brain is shutting down...;)

jeehell
07-04-2008, 08:21 PM
I have tested this one with sioc:

Var 0032, name SWITCH, Link FSUIPC_INOUT, Offset $132C, Length 4
{
&O_VNAV = &SWITCH
}

Var 0090, name O_VNAV, Link IOCARD_OUT, Output 25

Var 0154, Link IOCARD_SW, Input 30, Type P // I_VNAV
{
IF &SWITCH = 0
{
&SWITCH = 1
}
ELSE
{
&SWITCH = 0
}
}



Be careful with wordwrap when copying/pasting, else I don't why it went wrong, as it's late here as well ;)

CoNa
07-05-2008, 04:44 AM
Thanks, that did the trick :D
I really appreciate the support I get here.
Make it a bit easier being a noob.