Switching DC line polarity using 2-channel latching relay TQ2SA-L2-5V (RSN(699-6269)). Relays are driven by digital port of power supply. External power (5V) is needed, but lutching relays will not switch polarity if it fails. Pin 8 is used to check power, pins 0..7 can be used for switching channels 1..4 (two pins per channel).
TCL code. This switch is supported by DeviceRole library (see r_power_supply.tcl).