In plants consisting of multiple interacting subsystems, the decision on how to optimally select and place actuators and sensors and the accompanying question on how to control the overall plant is a challenging task. Since there is no theoretical framework describing the impact of sensor and actuator placement on performance, an optimization method exploring the possible configurations is introduced in this paper to find a trade-off between implementation cost and achievable performance.Moreover, a novel model-based procedure is presented to simultaneously co-design the optimal number, type and location of actuators and sensors and to determine the corresponding optimal control architecture and accompanying control parameters. This paper adds the optimization of the control architecture to the current state-of-the-art. As an optimization output, a Pareto front is presented, providing insights on the optimal total plant performance related to the hardware and control design implementation cost.The proposed algorithm is not focused on one particular application or a specific optimization problem, but is instead a generally applicable method and can be applied to a wide range of applications (e.g., mechatronic, electrical, thermal). In this paper, the co-design approach is validated on a mechanical setup.