Problems with SIOC code for PM MCP-737Ng
Pan-pan from MCp builder!
This short sioc code works fine unntil I turn the
encoder fast to change Hdg, the Hdg value start to oscillate on one to or all digits. Which digits is random.
It occur both on the Opencockpits Mcp-737NG(Hardware) display and on the software Pm Mcp.
I have tried to use sub-routines, no help, changing the
encoder acceleration, and startet the code from different
angels. In the end same result.
Please try to give me a hint of what to change, and indicate if I have made I prinsipal error.
Nedless to say I em new in writing sioc code.
Thanks in advance.
Regards
Nils
// The Heading (Hdg) part of code for
//Opencockpits MCP-737NG with PM software on W.Vista.
Var 0004, name Hdgfrom, Link FSUIPC_IN, Offset $04E2, Length 2 // Hdg from Mcp
{
V0006 = &Hdgfrom
}
Var 0008, name Hdgto, Link FSUIPC_OUT, Offset $5408, Length 2 // Hdg to Mcp
Var 0010, name DispA, Link IOCARD_DISPLAY, Digit 6, Numbers 3 // Display on hardware
Var 0011, name Enco, Link IOCARD_ENCODER, Input 6, Aceleration, Type 2 // Gray code encoder
{
L0 = &Enco * -1
V0006 = ROTATE 0 ,359 ,L0
}
Var 0006 // Hdg read from both offsets
{
&DispA = V0006
&Hdgto = V0006
}