The last extension I would like to show you is to add lights testing of the 3 digit display.
Lekseecon provides separate lights tests for three sections of the aircraft Overhead, MIP and Pedestal.
Since the VOR1 CRS is part of the MIP so we
add Var 580 to our script. With this variable we can activate a lights test for
all led's and displays of the MIP. Some variables (mostly led's), have built in support,
then we have to do nothing else, but for VOR1 CRS we have to add a small test in
the OutVOR1Crs subroutine.
Every time lekseecon detects a change in Var 580, it will
(just like it does for cold and dark state changes) write a new value in "refresh" Var 999
and the OutVOR1Crs subroutine is called.
Var 268 Static
{
CALL &OutVOR1Crs
}
Var 9001 name RO_VOR1Crs Link IOCARD_ENCODER Input 36 Type 2
{
L0 = &RO_VOR1Crs
v268 = ROTATE 0 359 L0
}
Var 9002 name D_VOR1Crs Link IOCARD_DISPLAY Digit 0 Numbers 3
Var 782 Static
{
&ColdAndDark = TESTBIT v782 0
}
Var 9003 name ColdAndDark
Var 999 Static
{
CALL &OutVOR1Crs
}
Var 580 Static name TestMIP Link IOCARD_SW Input 56 Type P
Var 9004 name OutVOR1Crs Link SUBRUTINE
{
IF &ColdAnddark = 1
{
&D_VOR1Crs = -999999 // blank display
}
ELSE
{
IF &TestMIP = 1
{
&D_VOR1Ctrs = 888 // let all segments lit.
}
ELSE
{
&D_VOR1Crs = v268
}
}
}
Note that Vars 782, 9003, 999 and 580 can be used throughout your SIOC program.
If you would later add VOR2 CRS, the SIOC code for that part could only be:
Var 272 Static
{
CALL &OutVOR2Crs
}
Var 9011 name RO_VOR2Crs Link IOCARD_ENCODER Input 38 Type 2
{
L0 = &RO_VOR2Crs
v272 = ROTATE 0 359 L0
}
Var 9012 name D_VOR2Crs Link IOCARD_DISPLAY Digit 3 Numbers 3
Var 9014 name OutVOR2Crs Link SUBRUTINE
{
IF &ColdAnddark = 1
{
&D_VOR2Crs = -999999 // blank display
}
ELSE
{
IF &TestMIP = 1
{
&D_VOR2Ctrs = 888 // let all segments lit.
}
ELSE
{
&D_VOR2Crs = v272
}
}
}
While var 999 needs to be updated, just add the CALL to the OutVOR2Crs subroutine.
Var 999 Static
{
CALL &OutVOR1Crs
CALL &OutVOR2Crs
}