A short cut is to use a product that exist. Any switching mode power supply 100-260VAC to 24VDC can do the job. Example:
https://www.ebay.co.uk/itm/Dymo-Lab...511636?hash=item5b088d72d4:g:H1EAAOSw7ThUdGo0
When you connect the 240VAC input to your 345VDC battery you get isolated 24VDC which you can connect to the top of the 345V.
In the power supply that you buy the AC input is always rectified to DC that converted to 24VDC. When you connect 345VDC instead of the mains the converter inside gets 345VDC which is the same as rectified 260VAC.
The polarity of the input to the converter is not important, you can also connect it to any part of the battery that gives at least 160VDC , which equivalent to 100VAC.