Zibo's TCAS is zibomod's own C++ code (Tcas_system, B738_tcas, tcas_test, tcas_ra_output, tcas_clr*,
clear_ra_flag, rst_tcas_mem) and the transponder mode knob's commands (CMD_xponder_mode_up / _dn / _test).
They are translated with the Systems loop (tools/re/gen_sys.sh, sys_functions.txt → wasm/src/core/sys/sys_gen.*),
so the traffic symbols, TA / RA logic, the RA's PFD pitch limits and the TCAS test pattern are Zibo's.
Checked against Zibo#
- Oracle scenario
xphost/test/sci/tcas_trace.json(tools/re/tcas_scenario.py): airborne at FL100, every global of the TCAS functions traced around zibomod'sSystems -> Tcas_systemcall (host hookstcas/tcas_out), one frame in five. It covers the TCAS test (knob held at TEST), other traffic, proximate traffic, two head-on encounters (TA, RA, clear of conflict) and an overtaking, descending target. The targets are X-Plane 12's TCAS arrays, moved by the host. wasm/test/test_tcas_replay.cpp: every sample replayed on the translation. Identical on all 2543 samples (1010 with an RA message, 282 with a TA).wasm/test/test_fms.cpptcas_traffic_in_the_systems: the whole module, with MSFS traffic as the adapter gives it:- the TCAS test from the knob;
- TA/RA selected;
- a head-on target: other traffic → proximate → TA at 4.9 nm → RA at 3.2 nm, with the PFD's RA bands;
- the altitude label "+06";
- a target on the ground and one 55 nm away, neither shown.
MSFS's traffic → Zibo's targets#
zibomod reads X-Plane 12's arrays sim/cockpit2/tcas/targets/position/lat|lon|ele (index 0 is the own aircraft;
slots 1–18 are used). Here:
- The adapter (
wasm/src/msfs/gauge.cpp) asks SimConnect about once a second for the aircraft and helicopters within 40 nm (SimConnect_RequestDataOnSimObjectType). It reads their position,VELOCITY WORLD X/Z/Y,SIM ON GROUNDandIS USER SIM(the own aircraft is dropped). - The slots (
wasm/src/core/tcas/traffic.h):- Each aircraft keeps its slot while it is around. zibomod remembers each slot's last position for its closure rates, so a slot that changed aircraft would jump.
- New aircraft take free slots, nearest first, airborne before on the ground. Otherwise an airport's parked and taxiing aircraft would fill the 18 slots and hide the aircraft in the air.
- Between SimConnect's answers, the positions move on with each aircraft's velocity every frame, as X-Plane's do.
- The other inputs are what zibomod reads elsewhere:
- air data and attitude: the AFDS's;
- the attitude flag: the IRS;
- TFC buttons, ND modes and ranges: the EFIS / navigation;
- the TCAS range: the Lua FMS.
Cockpit#
- The transponder mode knob (
TRANSPONDER_MODE): INC / DEC moves it a position (TEST, STBY, ALT OFF, XPNDR, TA ONLY, TA/RA;L:LU737_KNOB_TRANSPONDER_POS). DEC held at STBY for 1.7 s runs the TCAS test (TEST is spring-loaded back to STBY), as Zibo's. - zibomod's X-Plane transponder mode becomes MSFS's
TRANSPONDER STATE(off / standby / test / on / alt), which is what ATC and MSFS's traffic see.
Displays#
- The numbers become
L:LU737_DU_*(tools/re/du_exports.py): traffic positions, symbol types, arrows, the shown / OFF / TEST / FAIL flags, the RA's PFD pitch limits. - The altitude labels go with the ND's symbols on the CommBus (
LU737_ND_SYM).
Not modelled#
- TCAS's aural alerts ("TRAFFIC, TRAFFIC", "CLIMB"): sounds are not done yet.
- The traffic's own TCAS (coordinated RAs): MSFS's AI does not manoeuvre.