Hi,
Right now, if the SOC is more than 100, A will be 1. If SOC is less than 50, B will be 1. However, we will have a case where the SOC will be less than 100 and more than 50. When this happen, both A and B will be 0, we will not know if its charging or discharging.
How can we make sure that only either one of the process is suppose to run at anytime?