The invention relates to an X-ray device (2) for a medical workplace (1, 21). The X-ray device (2) comprises a robot (R) with a plurality of axes (9), a control device (10) for controlling the axes (9) for movement of the robot (R), and a fastening device (8), and a support device (11) disposed at the fastening device (8), said support device comprising an X-ray radiation source (12) and an X-ray radiation receiver (14). A 3D model (15, 15a) of the robot (R) and the support device (11) provided is stored in the control device (10), said 3D model modeling the spatial extension of the robot (R) and the support device (11) during movement of the robot (R). The 3D model (15,15a) also models the spatial extension of at least one other device (3, 4, R2) of the medical workplace (1, 21) and/or of a living organism (5) located within the medical workplace (1, 21). The control device (10) recognizes a potential collision of the X-ray device (2) with the other device (3, 4, R2) and/or the living organism (5) based on the 3D model (15,15a) and prompts the robot (R) to take action to avoid the potential collision.