Hi,
I`m having trouble figuring it out how to "read" the battery voltage in a particular situation in the circuit shown below.

The problem is, when a disconnect the battery the 27V in DC_In appears in V_Bat and I have a false positive, like, my system thinks that there is a battery plugged in, with 27V, but it`s not true, is`s just the DC_In appearing in V_Bat.
How can I isolate the battery voltage and the DC_In voltage? I need to recharge and discharge the battery, so that is why there is this 3 diodes.
Thanks!
I`m having trouble figuring it out how to "read" the battery voltage in a particular situation in the circuit shown below.

The problem is, when a disconnect the battery the 27V in DC_In appears in V_Bat and I have a false positive, like, my system thinks that there is a battery plugged in, with 27V, but it`s not true, is`s just the DC_In appearing in V_Bat.
How can I isolate the battery voltage and the DC_In voltage? I need to recharge and discharge the battery, so that is why there is this 3 diodes.
Thanks!