First, create an up-to-date record of the cabinet that actually operates the machine
Check that the electrical schematic, PLC program, HMI project and bill of materials represent the same version. A relay added on site, a replaced sensor or a manually installed jumper may be missing from the schematic. Compare cable labels, power supply groups, terminal order and device models with the actual machine. An NDA can be agreed before technical information is shared; permission to use and modify the necessary files must also be clarified.
Record the normal production cycle and less frequent conditions: setup, product changeover, stopping, maintenance and restarting. The program alone may not explain why a setting has a particular value or which mechanical requirement a delay addresses. Capture the knowledge of operators and maintenance staff in the requirements document. The first deliverable is a verifiable description of existing behaviour, rather than a board schematic.