A method for transmitting data via direct current lines (3, 4) for energy transmission from a first communication unit to a second communication unit (10a, 10b, 10c) in a photovoltaic installation with a PV-generator, wherein the PV-generator comprises at least one string (1a, 1b) electrically connected to an inverter via the direct current lines (3, 4), and wherein the inverter and the at least one string (1a, 1b) each are associated with one of the first and second communication units (10a, 10b, 10c), comprising the following steps: - generation of a high-frequency test signal having a predefined voltage amplitude (u TXa, u TXc) by the second communication unit (10a, 10b, 10c) and coupling the high-frequency test signal onto the direct current lines (3, 4); - determination of a level of a current (i a, i b, i c) caused by the high-frequency test signal on the direct current lines (3, 4) by the first communication unit (10a, 10b, 10c); - determination of a voltage amplitude for a high-frequency signal for data transmission dependent on the level of the current (i a, i b, i c) caused by the test signal, characterized in that - for determining the voltage amplitude for the high-frequency signal for data transmission from the current (i a, i b, i c) caused by the test signal and the predetermined voltage amplitude (u TXa, u TXc) of the test signal, an impedance of a transmission path for the high-frequency signal on the direct-current lines (3, 4) is calculated with a known impedance of the communication units (10a, 10b, 10c) and assuming that the inverter has a negligibly small impedance, and - a high-frequency signal with the previously determined voltage amplitude of the high frequency signal for data transmission is coupled onto the direct current lines (3, 4) by the first communication unit (10a, 10b, 10c) for data transmission to the second communication unit (10a, 10b, 10c). - generation of a high-frequency test signal having a predefined voltage amplitude (u TXa, u TXc) by the second communication unit (10a, 10b, 10c) and coupling the high-frequency test signal onto the direct current lines (3, 4); - determination of a level of a current (i a, i b, i c) caused by the high-frequency test signal on the direct current lines (3, 4) by the first communication unit (10a, 10b, 10c); - determination of a voltage amplitude for a high-frequency signal for data transmission dependent on the level of the current (i a, i b, i c) caused by the test signal, characterized in that - for determining the voltage amplitude for the high-frequency signal for data transmission from the current (i a, i b, i c) caused by the test signal and the predetermined voltage amplitude (u TXa, u TXc) of the test signal, an impedance of a transmission path for the high-frequency signal on the direct-current lines (3, 4) is calculated with a known impedance of the communication units (10a, 10b, 10c) and assuming that the inverter has a negligibly small impedance, and - a high-frequency signal with the previously determined voltage amplitude of the high frequency signal for data transmission is coupled onto the direct current lines (3, 4) by the first communication unit (10a, 10b, 10c) for data transmission to the second communication unit (10a, 10b, 10c).