Pigeonholes Explained


Requirements: Peter Dowson's EPIC VXD software.

What in the world is a pigeonhole?
In simplest terms, it's a place your EPIC system uses to store information about certain airplane and flight parameters. This article explains how to find that information and deliver it to EPIC. Pigeonholes are used primarily with Peter Dowson's EPIC VXD software. Without it, you can't talk to them.

A typical Pigeonhole statement looks like this:

DefinePH(17, AP_IAS_Lock, 0,0,0,0) ;Autopilot IAS Setting

All this means is that when the values in Pigeonhole 17 change, call the AP_IAS_Lock routine. Pigeonholes that contain values such as Engine N1, N2 values, or Mag Heading values, change quite frequently, while others such as the autopilot IAS hold remains static and changes only when the pilot selects it.

Extracting Pigeonhole Values:
Pigeonhole 17 in the above definition is defined in decimal, or Base-10 format. Extracting the Pigeonhole valule and sending that value to an EPIC Display module is a different story. Extraction will use Hex numbers to define exactly what part of the Pigeonhole we'll be addressing.

This statement gets Byte 0 of PH17 and places the value in the 8-bit variable defined as 'Temp8'. ('Temp8' can be any defined variable... you can even call it 'Junk8'. I usually use a trailing 8 or 16 just so I remember if it's an 8-bit or 16-bit variable)

#expand getph8(Temp8, 0x0011)
The value '11' is HEX for '17'

Once the value is extracted, we can send it to a display:

setdisplay(D_AP_IAS_lo, Temp8)

Extracting 8-bit (Byte) values:
For the sake of demonstration, let's finish extracting the Autopilot IAS Value: Here you'll notice that the upper part of the IAS value resides in Byte '1', as highlighted in Bold Red.

#expand getPH8(temp8, 0x0111)
setdisplay(D_AP_IAS_hi, temp8)

Extracting 16-bit (Word) Values:
To extract a WORD value, the only thing you need to be aware of is that the variable you extract to should be a 16-bit variable using the GETPH16 function.

#expand getPH16(temp16, 0x0111)

Is it really this easy?
Well... it is... sort of. Defining the Pigeonhole and byte locations are easy. You will notice that the values provided by FS2000/FS98 do not always conform to logic. As you will read in subsequent articles, pinpointing certain values can become frustrating and some require mathematical translation before a recognizable value can be sent to an EPIC display. Some are downright elusive, but with patience and some 'creative programming', you can extract most any value from the sim.

Summary:

First, Define the Pigeonhole in DECIMAL Format:

DefinePH(17, AP_IAS_Lock, 0,0,0,0) ;Autopilot IAS Setting

Second, extract PH values by addressing one of 4 possible bytes (or words if you are extracting an entire word) in HEX:

#expand getph8(Temp8, 0x0011) -- Extract Byte 0 from PH17
#expand getph8(Temp8, 0x0111) -- Extract Byte 1 from PH17
#expand getph8(Temp8, 0x0211) -- Extract Byte 2 from PH17
#expand getph8(Temp8, 0x0311) -- Extract Byte 3 from PH17

Third, -do- something with the extracted value, such as:

setdisplay(D_AP_IAS_hi, temp8)

That's it! All you need to remember is Decimal values for defining, Hex values for extracting.