To meet the real-time diagnosis requirements of the complex system, this study proposes a novel framework for real-time fault diagnosis using dynamic fault tree analysis. It pays special attention to meeting two challenges: model development and real-time reasoning. In terms of the challenge of model development, we use a dynamic fault tree model to capture the dynamic behavior of system failure mechanisms and calculate some reliability results by mapping a dynamic fault tree into an equivalent Bayesian Network (BN) in order to avoid the infamous state space explosion problem. In terms of the real-time reasoning challenge, we adopt a logic compilation based inference algorithm, which compiles the BN into an arithmetic circuit and retrieves answers to probabilistic queries by evaluating and differentiating the arithmetic circuit. Furthermore, we incorporate sensors data into fault diagnosis, cope with the sensors reliability and propose the schemes on how to update the Diagnostic Importance Factor (DIF) and the minimal cut sets. Finally, a case study is given to validate the efficiency of this method.