In this thesis, a tracking system was developed by modifying an add-on collimator, the Siemens Moduleaf, for realtime applications in radiotherapy. As the add-on collimator works almost completely autonomously of the linear accelerator (LinAc), no modifications to the latter were necessary. The adaptations to the Moduleaf were mainly software-based. In order to reduce the complexity of the system, outdated electronic parts were replaced with newer...