// Coordenadas de Latitud y Longitud para el IRs // lleva incorporado un cronometro para simular en el display // el tiempo de aliniado,el codigo es doble para dos display lcd 16x2 // felices vuelos Var 3010, Link FSUIPC_IN, Offset $0564, Length 4 // HI of LAT Var 3011, Link FSUIPC_IN, Offset $0560, Length 4 // LO of LAT { L1 = V3010 L0 = V3011 IF L0 < 0 // convert to unsigned { L0 = L0 + 4294967296 } L0 = L0 / 4294967296 IF L1 > 0 // Now, if negative is S, positive is North { L2 = L1 + L0 } ELSE { L2 = L1 - L0 } L2 = L2 * 90 L2 = L2 / 10001750 V3012 = TRUNC L2 // Convert to Degrees L2 = L2 - V3012 L2 = L2 * 10000 L2 = L2 * 0.6 // 60/100 for mins. V3013 = DIV L2 ,100 // Mins L0 = V3013 * 100 V3014 = L2 - L0 // Secs } Var 3015 // variable del lcd Var 3012 // LAT degrees Var 3013 // LAT min Var 3014 // LAT sec Var 3016, Link FSUIPC_IN, Offset $0568, Length 4 // low long Var 3017, Link FSUIPC_IN, Offset $056C, Length 4 // low lat { L1 = V3017 L0 = V3016 IF L0 < 0 { L0 = L0 + 4294967296 } L0 = L0 / 4294967296 IF L1 > 0 { L2 = L1 + L0 } ELSE { L2 = L1 - L0 } IF L2 < 0 { L2 = L2 * -1 } L2 = L2 * 360 L2 = L2 / 4294967296 V3018 = TRUNC L2 L2 = L2 - V3018 L2 = L2 * 10000 L2 = L2 * 0.6 V3019 = DIV L2 ,100 L0 = V3019 * 100 V3020 = L2 - L0 L2 = L2 / 10 V3021 = TRUNC L2 } Var 3018 // long grados Var 3019 // long minu Var 3020 // long seg Var 3021 // variable del lcd // posicion de las entradas Var 3022, Link IOCARD_SW, Device 20, Input 222 { IF V3022 = 1 { V3015 = 1 } } Var 3023, Link IOCARD_SW, Device 20, Input 221 { IF V3023 = 1 { V3015 = 0 V3021 = 0 } } Var 3024, Value 0 { V3015 = 1 } Var 3025, Link IOCARD_SW, Device 20, Input 222 Var 3026, Link IOCARD_SW, Device 20, Input 223 { IF V3026 = 1 { V3024 = 1 } } Var 3027, Link FSUIPC_IN, Offset $023A, Length 1 { IF V3025 = 1 { L0 = V3024 + 1 IF L0 = 180 { L0 = 0 } V3024 = L0 } } Var 3028, Value 0 { V3021 = 1 } Var 3029, Link IOCARD_SW, Device 20, Input 222 Var 3030, Link IOCARD_SW, Device 20, Input 223 { IF V3030 = 1 { V3028 = 1 } } Var 3031, Link FSUIPC_IN, Offset $023A, Length 1 { IF V3029 = 1 { L0 = V3028 + 1 IF L0 = 180 { L0 = 0 } V3028 = L0 } }