MortenHa
02-15-2009, 07:01 AM
Hi folks!
Now that the MCP is ready to go,next step is to get the EFIS panels online!
We have run into numerous problems with the code, but I'll only present one problem at a time:
Here's part of the script, dealing with the BARO rotary encoders
// PM FSUIPC write offset for QNH Capt.
//-------------------------------------
// DEPENDENCIES:
// RE_E1_PRES
//
// USE:
// This PM offset holds the barometric pressure for setting QNH
// on the Captain side. Controlled with the rotary encoder variable
// RE_E1_PRES
//
//**************************************************************
Var 0066 name F_E1_PRES, Link FSUIPC_OUT , Offset $0330, Length 2
// PM FSUIPC write offset for QNH F/O
//-----------------------------------
// DEPENDENCIES:
// RE_E2_PRES
//
// USE:
// This PM offset holds the barometric pressure for setting QNH
// on the First Officer side. Controlled with the rotary encoder variable
// RE_E2_PRES
//
//**************************************************************
Var 0067 name F_E2_PRES, Link FSUIPC_OUT , Offset $552E, Length 2
// IO ROTARY-ENCODER Link Set QNH Capt.
//-------------------------------------
// DEPENDENCIES:
// None
//
// USE:
// Rotary encoder used to change FSUIPC Offset $0330 (&F_E1_PRES)
// controlling the QNH setting
//
// CODE:
// The value is modified to:
// - Change the sign because the value increments/decrements in reverse
// - Multiply by 16 to show HPa
//
//****************************************************************************
Var 0306 name RE_E1_PRES, Link IOCARD_ENCODER , Input 54, Aceleration 6, Type 2
{
L0 = &RE_E1_PRES * -16 // Rotary turns the wrong way, multiply by 16 and store in locvar L0
&F_E1_PRES = ROTATE 960, 1050, L0
}
// IO ROTARY-ENCODER Link Set QNH F/O
//-----------------------------------
// DEPENDENCIES:
// None
//
// USE:
// Rotary encoder used to change PM FSUIPC Offset $552E (&F_E2_PRES)
// controlling the QNH setting
//
// CODE:
// The value is modified to:
// - Change the sign because the value increments/decrements in reverse
// - Multiply by 16 to show HPa
//
//****************************************************************************
Var 0308 name RE_E2_PRES, Link IOCARD_ENCODER , Input 126, Aceleration 6, Type 2
{
L0 = &RE_E2_PRES * -16 // Rotary turns the wrong way, multiply by 16 and store in locvar L0
&F_E2_PRES = ROTATE 960, 1050, L0
}
The statements:
L0 = &RE_E1_PRES * -16 // Rotary turns the wrong way, multiply by 16 and store in locvar L0
&F_E1_PRES = ROTATE 960, 1050, L0
It doesn't work as expected. Changing the sign in value L0 is to get the rotary to turn the "right way"
And it is multiplied by 16 as per definition found in the FSUIPC offset table.
The ROTATE statement does not work correctly either.
Anyone any clue?
Morten & Lasse
Now that the MCP is ready to go,next step is to get the EFIS panels online!
We have run into numerous problems with the code, but I'll only present one problem at a time:
Here's part of the script, dealing with the BARO rotary encoders
// PM FSUIPC write offset for QNH Capt.
//-------------------------------------
// DEPENDENCIES:
// RE_E1_PRES
//
// USE:
// This PM offset holds the barometric pressure for setting QNH
// on the Captain side. Controlled with the rotary encoder variable
// RE_E1_PRES
//
//**************************************************************
Var 0066 name F_E1_PRES, Link FSUIPC_OUT , Offset $0330, Length 2
// PM FSUIPC write offset for QNH F/O
//-----------------------------------
// DEPENDENCIES:
// RE_E2_PRES
//
// USE:
// This PM offset holds the barometric pressure for setting QNH
// on the First Officer side. Controlled with the rotary encoder variable
// RE_E2_PRES
//
//**************************************************************
Var 0067 name F_E2_PRES, Link FSUIPC_OUT , Offset $552E, Length 2
// IO ROTARY-ENCODER Link Set QNH Capt.
//-------------------------------------
// DEPENDENCIES:
// None
//
// USE:
// Rotary encoder used to change FSUIPC Offset $0330 (&F_E1_PRES)
// controlling the QNH setting
//
// CODE:
// The value is modified to:
// - Change the sign because the value increments/decrements in reverse
// - Multiply by 16 to show HPa
//
//****************************************************************************
Var 0306 name RE_E1_PRES, Link IOCARD_ENCODER , Input 54, Aceleration 6, Type 2
{
L0 = &RE_E1_PRES * -16 // Rotary turns the wrong way, multiply by 16 and store in locvar L0
&F_E1_PRES = ROTATE 960, 1050, L0
}
// IO ROTARY-ENCODER Link Set QNH F/O
//-----------------------------------
// DEPENDENCIES:
// None
//
// USE:
// Rotary encoder used to change PM FSUIPC Offset $552E (&F_E2_PRES)
// controlling the QNH setting
//
// CODE:
// The value is modified to:
// - Change the sign because the value increments/decrements in reverse
// - Multiply by 16 to show HPa
//
//****************************************************************************
Var 0308 name RE_E2_PRES, Link IOCARD_ENCODER , Input 126, Aceleration 6, Type 2
{
L0 = &RE_E2_PRES * -16 // Rotary turns the wrong way, multiply by 16 and store in locvar L0
&F_E2_PRES = ROTATE 960, 1050, L0
}
The statements:
L0 = &RE_E1_PRES * -16 // Rotary turns the wrong way, multiply by 16 and store in locvar L0
&F_E1_PRES = ROTATE 960, 1050, L0
It doesn't work as expected. Changing the sign in value L0 is to get the rotary to turn the "right way"
And it is multiplied by 16 as per definition found in the FSUIPC offset table.
The ROTATE statement does not work correctly either.
Anyone any clue?
Morten & Lasse