In the ldquodigital factoryrdquo tool chain, usually only the nominal production sequence, i.e. the production process under ideal conditions, is considered and automatically converted into PLC code. However, the nominal sequence is a prominent but rather small fraction of the total PLC code. The large remaining parts, such as interlock logic, safety functions, start-up and shutdown sequences, are mostly neglected. In the approach described in this paper, the authors focus on this part of the control code and strive for a concept to automatically generate a significantly larger part of the control code of a production plant, based on plant and process information which is already available.