#################################### # Calculate absolute HGA Elevation # #################################### # Use APME HGA x scvOP to determine which is IN-USE (2) if (NCSD3JC4.raw == 2) then # HGA A VAR_rawMSB := NAH0Z006.raw; VAR_rawLSB := NAHD0039.raw; else if (NCSD3JD4.raw == 2) then # HGA B VAR_rawMSB := NAH0Z040.raw; VAR_rawLSB := NAHT0039.raw; else # Neither! VAR_rawMSB := 0; VAR_rawLSB := 0; endif; endif; # Masks and shifts to be performed VAR_MSB_MASK := 31; VAR_MSB_SHIFT := 16; VAR_LSB_MASK := 65535; # Mask and shift MSB VAR_MSB := ((VAR_rawMSB and VAR_MSB_MASK) << VAR_MSB_SHIFT); # Mash LSB VAR_LSB := (VAR_rawLSB and VAR_LSB_MASK); # Or them together return (VAR_MSB or VAR_LSB);