The problem of designing an integrated control and diagnostic module is considered. The four degree of freedom controller is recast into a general framework wherein results from optimal and robust control theory can be easily implemented. For the case of an 'If2 objective, it is shown that the optimal control-diagnostic module involves constructing an optimal controller, closing the loop with this controller, and then designing an optimal diagnostic module for the closed loop. When uncertain plants are involved, this two-step method does not lead to reasonable diagnostics, and the control and diagnostic modules must be synthesized simultaneously. An example shows how this design can be accomplished with available methods.