How to program for Level-D 767

This page gives some basic examples of how to program in SIOC using the 805 pre-defined variables that represent the powerful Level-D 767.

If you have installed the lekseecon program, you will be able to read from and write to the Level-D 767 by using one or more of these pre-defined SIOC variables. The Link to Level-D 767 is implicitly existent, there is no need to define it yourself.

Every lekseecon SIOC variable that you are using in your program is detected by lekseecon. All the links to the Level-D 767 are made automatically. Easy, is it not?!

Programming advice: Always add attribute Static to a lekseecon variable and start the numbering of other variables then lekseecon variables from 1000 or above (I use 9001 and higher).

 

 

Question

Jump to top of this page


FMC's EXEC and MSG lights

You can obtain the state of the EXEC and MSG lights of the FMC by using lekseecon Var 771. As soon as the state of these lights in the Level-D SDK change, lekseecon will inform SIOC and Var 771 will be updated.

 Var 771 Static
 {
   v9001 = TESTBIT v771 1
   v9002 = TESTBIT v771 0
 }

 Var 9001 Link IOCARD_OUT Output 75
 Var 9002 Link IOCARD_OUT Output 76

As soon as Var 771 gets updated the code in the body is executed. Var 9001 will be set according to bit 1 of Var 771 and Var 9002 will be set according to bit 0 of Var 771. So the led's connected to the outputs linked to Vars 9001 and 9002 will show the right status.

The definition of Var 771 can be found in the lekseecon user Manual, Section 5.1

Jump to top of this page


Set Nose Landing lights

Var 265 is another SIOC variable predefined by lekseecon. With it you can control the Nose Landing Light of the 767 (see Section 2.29 of the lekseecon User Manual). We only have to link an On/Off type switch to var 265.

 Var 265 Static Link IOCARD_SW Input 134 Type I // Nose Landing Lights

If you change the position of the switch, var 265 will get a new value (either 0 or 1). This value change is notified by SIOC to lekseecon and lekseecon will call the Set Nose Landing Gear function of the SDK with the right parameter (0 or 1).

Jump to top of this page


Landing Gear Lever

If you use a three position Rotary Switch for controlling the Landing Gear Lever (section 4.11 of lekseecon User Manual) you simply connect each terminal of that Switch to a pre-defined SIOC Var, and lekseecon will do the rest…

 Var 368 Static Link IOCARD_SW Input 73 Type I // Down
 Var 369 Static Link IOCARD_SW Input 72 Type I // Off
 Var 370 Static Link IOCARD_SW Input 74 Type I // Up

Due to the mechanical construction of a rotary switch only one of the three terminal positions will be grounded, so only one of the 3 SIOC variables 368, 369 and 370 will be 1, the other two will be 0.

Jump to top of this page


Transponder keyboard

Lekseecon has defined a Toggle type variable for each of the nine buttons of the Transponder keyboard (see User Manual, section 5.11). You only have to connect a push button to each variable.

 Var 527 Static Link IOCARD_SW Input 47 Type P // key 1
 Var 528 Static Link IOCARD_SW Input 46 Type P // key 2
 Var 529 Static Link IOCARD_SW Input 45 Type P // key 3
 Var 530 Static Link IOCARD_SW Input 50 Type P // key 4
 Var 531 Static Link IOCARD_SW Input 49 Type P // key 5
 Var 532 Static Link IOCARD_SW Input 48 Type P // key 6
 Var 533 Static Link IOCARD_SW Input 53 Type P // key 7
 Var 534 Static Link IOCARD_SW Input 52 Type P // key 0
 Var 554 Static Link IOCARD_SW Input 53 Type P // key CLR

If you push a button, the corresponding variable will change from 0->1 or from 1-> 0, this change is notified by SIOC to lekseecon and lekseecon will call the correct XPDR key pushed function of the Level-D SDK.

Typing the squawk code assigned by ATC on such a keyboard is a piece of cake, you can do it at the same time while you are confirming the squawk code to ATC ;-)

Jump to top of this page


VOR1 Crs

Lekseecon variable 268 has two functions, while it is a Read/Write value (indicated in the Type column of section 3.2 of the Manual with Vrw):

  • if you give that var a new value from within a SIOC script, lekseecon
    will send that value to the Level-D as being the new VOR 1 CRS value.
  • if you change the VOR1 CRS in the panel with the mouse, lekseecon will
    tell SIOC to write that value into var 268.

Due to this you will always start with the VOR1 Crs in the panel, synchronization is guaranteed.

The easiest way to change the VOR1 CRS is with a rotary encoder. In the following script the rotary encoder operates directly on var 268. It goes as follows: If you turn the rotary a bit, a delta value will be added to var 268 and because of the ROTATE function these values wrap around and will never be out of the range 0.. 359. Just what we want.

 Var 268 Static

 Var 9001 name RO_VOR1Crs Link IOCARD_ENCODER Input 36 Type 2
 {
    L0 = &RO_VOR1Crs
    v268 = ROTATE 0 359 L0
 }

An example may make this more clear:
Suppose the VOR1 Crs value in v268 is 100. Turning the rotary gives a delta value of +40, so v268 becomes 140. If we change that value in the panel with the mouse to 160, v268 becomes 160. Next time you turn the rotary causing a delta of +40, the new value in v268 will become 200 (and not 180). Just what we want.

Jump to top of this page


VOR1 Crs with 3-dig display

The previous example showed how we can change the VOR1 Course. Now we are going to extend that example with a 3 digit 7-segment display for showing the CRS value.

Every time var 268 gets a new value (either from the rotary or from the panel), the code in the body of v268 will write that to the 3 digit Display (var 9002).

 Var 268 Static
 {
   &D_VOR1Crs = v268
 }

 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

Jump to top of this page


VOR1 Crs, cold and dark

The previous example showed how we can display the VOR1 Crs. Now we are going to extend that example with cold and dark support, because if your aircraft is cold and dark you do not like to see digits displayed...

Lekseecon var 782 provides us the cold and dark information (bit 0). In the following script I make that bit available in Var 9003 (1 = ColdAnddark, 0 = normal).

The code for Var 286 has changed compared to the previous example, instead of writing to the display directly we call a subroutine OutVORCrs. In that subroutine we check for cold and dark situations, if so we blank the display, if not we do the normal writing.

So if the VOR1 Crs changes cold and dark is taken into account. However, the Crs can be stable but the aircraft switches off to cold and dark, or the other way around, these situation we have to cover as well. We do that by using lekseecon Var 999. That Var is assigned a (new) value by lekseecon every time the state of the cockpit changes. So we only have to add our call to the OutVOR1Crs routine in the body of var 999 and everything will work as expected.

 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 9004 name OutVOR1Crs Link SUBRUTINE
 {
   IF &ColdAnddark = 1
   {
     &D_VOR1Crs = -999999 // blank display
   }
   ELSE
   {
     &D_VOR1Crs = v268
   }
 }

Jump to top of this page


VOR1 Crs, C&D, lights test

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
 }

Jump to top of this page