I have a 12v battery Which supplies power to a system. The battery is charged from a solar panel . so as to ensure the protection from over charging the voltage of battery is to be measured regularly.but,it seems difficult to understand the voltage of the battery while it is connected to the output of the solar panel. How can I measure it's voltage while it is charging from the solar panel?
All battery chemistrys (and to a lesser extent individual designs) will exhibit different voltage/current characteristics whilst charging. It's reasonably obvious that to charge a battery, you need to exceed the no-load voltage of the cell, to encourage current to flow into the cell.
The chemistry of a cell also has (frequently) some temperature dependance, sometimes such that as a cell gets hotter, it's fully charged voltage drops (leading to the risk of thermal runaway).
When the cell is heavily discharged, its likely to take more current than your charger can supply, so you would be able to measure a voltage well below the fully-charged voltage - but as a generalisation, voltage is not a good way to detect end-of-charge.
Lead-acid cells are safe to float-charge (at around 2.25-2.3 volts per cell, once full, the charge current is small, and generates a small amount of heat with minimal damage). I believe lead-acid also charge at a safe current even when fully discharged if you apply the float voltage.
Lithium cells need to be current-limited when they are heavily discharged, and also must not be charged above about 4.2 volts per cell. You also need to avoid charging at 4.2v for longer than an hour or two (trade off between charged capacity, and number of cycles - 100 or 500 might be the result).
Finally, a solar panel is a current source. You can obtain maximum power from it (with an arbitrary light level) when you adjust the current drain so that the cell voltage is a value speccified by the manufacturer. A switching regulator can take advantage of this to provide the maximum output current at ~13V output voltage (if it supports MPPT).
During charging you can measure the battery directly across the terminals. Although your panels open circuit voltage may be 20 volts the voltage across the battery will be much closer to the actual battery voltage. The best reading however would be obtained by disconnecting the panels for a short time.