Browse Source

[Bug fixed][DM30][DW30][Charging info]: The present charged duration should not be the remain charging duration, vice versa.

2020.06.10 / TC Hsu

Actions: Change all usage about PresentChargedDuration and RemainChargingDuration of charging data. Currect the ChangeRemainTime() function name to ChangeChargingTime() and related macro names in the function.

Image version    : N/A
Image checksum   : N/A

Hardware PWB P/N : N/A
Hardware Version : N/A

Files:

	modified:   EVSE/Projects/DM30/Apps/Module_EvComm.c
	modified:   EVSE/Projects/DM30/Apps/Module_InternalComm.c
	modified:   EVSE/Projects/DM30/Apps/Module_LcmControl.c
	modified:   EVSE/Projects/DM30/Apps/Module_LcmControl.h
	modified:   EVSE/Projects/DM30/Apps/main.c
	modified:   EVSE/Projects/DW30/Apps/Module_EvComm.c
	modified:   EVSE/Projects/DW30/Apps/Module_InternalComm.c
	modified:   EVSE/Projects/DW30/Apps/Module_LcmControl.c
	modified:   EVSE/Projects/DW30/Apps/Module_LcmControl.h
	modified:   EVSE/Projects/DW30/Apps/main.c
TC_Hsu 4 years ago
parent
commit
b73fdcdac0

+ 4 - 4
EVSE/Projects/DM30/Apps/Module_EvComm.c

@@ -2723,7 +2723,7 @@ void CANReceiver()
                         _chargingData[targetGun]->EvBatterySoc = frame.data[1];
                         _chargingData[targetGun]->EvBatterytargetVoltage = ((short) frame.data[3] << 8) + (short) frame.data[2];
                         _chargingData[targetGun]->EvBatterytargetCurrent = ((short) frame.data[5] << 8) + (short) frame.data[4];
-                        _chargingData[targetGun]->PresentChargedDuration = ((short) frame.data[7] << 8) + (short) frame.data[6];
+                        _chargingData[targetGun]->RemainChargingDuration = ((short) frame.data[7] << 8) + (short) frame.data[6];
 
                         if (_chargingData[targetGun]->Type == _Type_Chademo)
                         {
@@ -3307,11 +3307,11 @@ int main(int argc, char *argv[])
 
                     if (chargingTime[_index] == 0)
                     {
-                        chargingTime[_index] = _chargingData[_index]->RemainChargingDuration;
+                        chargingTime[_index] = _chargingData[_index]->PresentChargedDuration;
                     }
                     else
                     {
-                        int passTime = _chargingData[_index]->RemainChargingDuration - chargingTime[_index];
+                        int passTime = _chargingData[_index]->PresentChargedDuration - chargingTime[_index];
 
                         if (passTime > 0)
                         {
@@ -3322,7 +3322,7 @@ int main(int argc, char *argv[])
                             }
 
                             _chargingData[_index]->PresentChargedEnergy += changingPow;
-                            chargingTime[_index] = _chargingData[_index]->RemainChargingDuration;
+                            chargingTime[_index] = _chargingData[_index]->PresentChargedDuration;
                         }
                     }
 

+ 2 - 2
EVSE/Projects/DM30/Apps/Module_InternalComm.c

@@ -1855,7 +1855,7 @@ void AcChargeTypeProcess()
                         ac_chargingInfo[0]->PresentChargingPower = (220 * (acChargingCurrent.OuputCurrentL1 / 10)) / 1000;
 
                     ftime(&_ac_endChargingTime);
-                    ac_chargingInfo[0]->RemainChargingDuration = DiffTimeb(_ac_startChargingTime, _ac_endChargingTime);
+                    ac_chargingInfo[0]->PresentChargedDuration = DiffTimeb(_ac_startChargingTime, _ac_endChargingTime);
 
                     // 用以判斷是否有在輸出
                     ac_chargingInfo[0]->IsCharging = acStatus.RelayStatus;
@@ -1882,7 +1882,7 @@ void AcChargeTypeProcess()
                     {
                         gettimeofday(&_ac_charging_comp, NULL);
                         ftime(&_ac_endChargingTime);
-                        ac_chargingInfo[0]->RemainChargingDuration = DiffTimeb(_ac_startChargingTime, _ac_endChargingTime);
+                        ac_chargingInfo[0]->PresentChargedDuration = DiffTimeb(_ac_startChargingTime, _ac_endChargingTime);
                     }
                 }
                     break;

+ 14 - 14
EVSE/Projects/DM30/Apps/Module_LcmControl.c

@@ -612,7 +612,7 @@ void ChangeBattMapAndValue(short page, int soc)
     DisplayValueToLcm(__soc_value_charging, cmd, sizeof(cmd));
 }
 
-void ChangeRemainTime(int sec)
+void ChangeChargingTime(int sec)
 {
     int h, m, s;
     byte cmd[10];
@@ -630,7 +630,7 @@ void ChangeRemainTime(int sec)
     s = (sec - (3600 * h) - (m * 60));
     sprintf((char *)value, "%02d:%02d:%02d", h, m, s);
     string2ByteArray(value, cmd);
-    DisplayValueToLcm(__remain_time_tx, cmd, sizeof(cmd));
+    DisplayValueToLcm(__charging_time_tx, cmd, sizeof(cmd));
 }
 
 void ChangeChargingEnergyValue(float energy)
@@ -908,10 +908,10 @@ void ProcessPageInfo()
                     if (_currentPage == _LCM_CHARGING)
                     {
                         ChangeAcBattMapAndValue(_LCM_CHARGING);
-                        if (ac_chargingInfo[0]->RemainChargingDuration >= 0)
-                            ChangeRemainTime(ac_chargingInfo[0]->RemainChargingDuration);
+                        if (ac_chargingInfo[0]->PresentChargedDuration >= 0)
+                            ChangeChargingTime(ac_chargingInfo[0]->PresentChargedDuration);
                         else
-                            ChangeRemainTime(0);
+                            ChangeChargingTime(0);
 
                         if (ac_chargingInfo[0]->PresentChargingPower >= 0.1)
                             ChangeChargingPowerValue(ac_chargingInfo[0]->PresentChargingPower);
@@ -931,10 +931,10 @@ void ProcessPageInfo()
                     else if (_currentPage == _LCM_COMPLETE)
                     {
                         ChangeAcBattMapAndValue(_LCM_COMPLETE);
-                        if (ac_chargingInfo[0]->RemainChargingDuration >= 0)
-                            ChangeRemainTime(ac_chargingInfo[0]->RemainChargingDuration);
+                        if (ac_chargingInfo[0]->PresentChargedDuration >= 0)
+                            ChangeChargingTime(ac_chargingInfo[0]->PresentChargedDuration);
                         else
-                            ChangeRemainTime(0);
+                            ChangeChargingTime(0);
 
                         if (ac_chargingInfo[0]->PresentChargingPower >= 0.1)
                             ChangeChargingPowerValue(ac_chargingInfo[0]->PresentChargingPower);
@@ -1022,10 +1022,10 @@ void ProcessPageInfo()
                     if (ShmSysConfigAndInfo->SysInfo.CurGunSelected == i)
                     {
                         ChangeBattMapAndValue(_LCM_CHARGING, _chargingInfoData[i]->EvBatterySoc);
-                        if (_chargingInfoData[i]->RemainChargingDuration >= 0)
-                            ChangeRemainTime(_chargingInfoData[i]->RemainChargingDuration);
+                        if (_chargingInfoData[i]->PresentChargedDuration >= 0)
+                            ChangeChargingTime(_chargingInfoData[i]->PresentChargedDuration);
                         else
-                            ChangeRemainTime(0);
+                            ChangeChargingTime(0);
 
                         if (_chargingInfoData[i]->PresentChargingPower >= 0)
                             ChangeChargingPowerValue(_chargingInfoData[i]->PresentChargingPower);
@@ -1048,10 +1048,10 @@ void ProcessPageInfo()
                     if (ShmSysConfigAndInfo->SysInfo.CurGunSelected == i)
                     {
                         ChangeBattMapAndValue(_LCM_COMPLETE, _chargingInfoData[i]->EvBatterySoc);
-                        if (_chargingInfoData[i]->RemainChargingDuration >= 0)
-                            ChangeRemainTime(_chargingInfoData[i]->RemainChargingDuration);
+                        if (_chargingInfoData[i]->PresentChargedDuration >= 0)
+                            ChangeChargingTime(_chargingInfoData[i]->PresentChargedDuration);
                         else
-                            ChangeRemainTime(0);
+                            ChangeChargingTime(0);
 
                         if (_chargingInfoData[i]->PresentChargingPower >= 0)
                             ChangeChargingPowerValue(_chargingInfoData[i]->PresentChargingPower);

+ 2 - 2
EVSE/Projects/DM30/Apps/Module_LcmControl.h

@@ -113,10 +113,10 @@ short __side_mid = 0x0094;
 short __conn_line_chag = 0x0096;
 short __batt_map = 0x0100;
 short __soc_value_charging = 0x0102;
-short __remain_time_map = 0x0106;
+short __charging_time_map = 0x0106;
 short __power_map = 0x0108;
 short __energy_map = 0x010A;
-short __remain_time_tx = 0x0110;
+short __charging_time_tx = 0x0110;
 short __output_eng_tx = 0x0120;
 short __total_out_eng_tx = 0x0130;
 short __conn_line_comp = 0x0140;

+ 10 - 8
EVSE/Projects/DM30/Apps/main.c

@@ -4044,7 +4044,7 @@ bool CheckBackendChargingTimeout(byte gunIndex)
     {
         if (ShmSysConfigAndInfo->SysConfig.MaxChargingDuration > 0)
         {
-            if (chargingInfo[gunIndex]->RemainChargingDuration > (ShmSysConfigAndInfo->SysConfig.MaxChargingDuration * 60))
+            if (chargingInfo[gunIndex]->PresentChargedDuration > (ShmSysConfigAndInfo->SysConfig.MaxChargingDuration * 60))
                 result = true;
         }
     }
@@ -4053,7 +4053,7 @@ bool CheckBackendChargingTimeout(byte gunIndex)
         // 隨插即充電的要看 offline
         if (ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration > 0)
         {
-            if (chargingInfo[gunIndex]->RemainChargingDuration > (ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration * 60))
+            if (chargingInfo[gunIndex]->PresentChargedDuration > (ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration * 60))
                 result = true;
         }
     }
@@ -4455,7 +4455,9 @@ int main(void)
                     {
                         PRINTF_FUNC("S_IDLE================================== %x \n", gun_index);
                         chargingInfo[gun_index]->RemainChargingDuration = 0;
+                        chargingInfo[gun_index]->PresentChargedDuration = 0;
                         chargingInfo[gun_index]->PresentChargedEnergy = 0;
+                        chargingInfo[gun_index]->EvBatterySoc = 0;
                         strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "");
                     }
                     else if (chargingInfo[gun_index]->SystemStatus == S_RESERVATION &&
@@ -4885,7 +4887,7 @@ int main(void)
                         OcppStartTransation(gun_index);
                     }
                     ftime(&endChargingTime[gun_index]);
-                    chargingInfo[gun_index]->RemainChargingDuration = DiffTimeb(startChargingTime[gun_index], endChargingTime[gun_index]);
+                    chargingInfo[gun_index]->PresentChargedDuration = DiffTimeb(startChargingTime[gun_index], endChargingTime[gun_index]);
 
                     if (chargingInfo[gun_index]->Type == _Type_Chademo)
                     {
@@ -4895,7 +4897,7 @@ int main(void)
                             RecordAlarmCode(gun_index, "012234");
                         }
                         else if ((chargingInfo[gun_index]->EvBatterytargetVoltage > 0 && chargingInfo[gun_index]->EvBatterytargetVoltage < SYSTEM_MIN_VOL) ||
-                            (chargingInfo[gun_index]->RemainChargingDuration >= 10 && chargingInfo[gun_index]->PresentChargingVoltage < SYSTEM_MIN_VOL))
+                            (chargingInfo[gun_index]->PresentChargedDuration >= 10 && chargingInfo[gun_index]->PresentChargingVoltage < SYSTEM_MIN_VOL))
                         {
                             // UVP
                             RecordAlarmCode(gun_index, "012289");
@@ -4918,7 +4920,7 @@ int main(void)
                         }
                         else if (isPrechargeStatus_gb(gun_index) == 10 &&
                                  ((chargingInfo[gun_index]->EvBatterytargetVoltage > 0 && chargingInfo[gun_index]->EvBatterytargetVoltage < SYSTEM_MIN_VOL) ||
-                                 (chargingInfo[gun_index]->RemainChargingDuration >= 10 && chargingInfo[gun_index]->PresentChargingVoltage < SYSTEM_MIN_VOL)))
+                                 (chargingInfo[gun_index]->PresentChargedDuration >= 10 && chargingInfo[gun_index]->PresentChargingVoltage < SYSTEM_MIN_VOL)))
                         {
                             // UVP
                             RecordAlarmCode(gun_index, "012290");
@@ -4940,7 +4942,7 @@ int main(void)
                             RecordAlarmCode(gun_index, "012235");
                         }
                         else if ((chargingInfo[gun_index]->EvBatterytargetVoltage > 0 && chargingInfo[gun_index]->EvBatterytargetVoltage < SYSTEM_MIN_VOL) ||
-                                 (chargingInfo[gun_index]->RemainChargingDuration >= 10 && chargingInfo[gun_index]->PresentChargingVoltage < SYSTEM_MIN_VOL))
+                                 (chargingInfo[gun_index]->PresentChargedDuration >= 10 && chargingInfo[gun_index]->PresentChargingVoltage < SYSTEM_MIN_VOL))
                         {
                             // UVP
                             RecordAlarmCode(gun_index, "012288");
@@ -5032,8 +5034,8 @@ int main(void)
                         PRINTF_FUNC ("complete......................... %x \n", gun_index);
                         OcppStopTransation(gun_index);
                         ftime(&endChargingTime[gun_index]);
-                        if (chargingInfo[gun_index]->RemainChargingDuration != 0)
-                            chargingInfo[gun_index]->RemainChargingDuration = DiffTimeb(startChargingTime[gun_index], endChargingTime[gun_index]);
+                        if (chargingInfo[gun_index]->PresentChargedDuration != 0)
+                            chargingInfo[gun_index]->PresentChargedDuration = DiffTimeb(startChargingTime[gun_index], endChargingTime[gun_index]);
 
                         StopGunInfoTimeoutDet(gun_index);
                         StartGunInfoTimeoutDet(gun_index, Timeout_EvseCompleteDet);

+ 4 - 4
EVSE/Projects/DW30/Apps/Module_EvComm.c

@@ -2723,7 +2723,7 @@ void CANReceiver()
                         _chargingData[targetGun]->EvBatterySoc = frame.data[1];
                         _chargingData[targetGun]->EvBatterytargetVoltage = ((short) frame.data[3] << 8) + (short) frame.data[2];
                         _chargingData[targetGun]->EvBatterytargetCurrent = ((short) frame.data[5] << 8) + (short) frame.data[4];
-                        _chargingData[targetGun]->PresentChargedDuration = ((short) frame.data[7] << 8) + (short) frame.data[6];
+                        _chargingData[targetGun]->RemainChargingDuration = ((short) frame.data[7] << 8) + (short) frame.data[6];
 
                         if (_chargingData[targetGun]->Type == _Type_Chademo)
                         {
@@ -3307,11 +3307,11 @@ int main(int argc, char *argv[])
 
                     if (chargingTime[_index] == 0)
                     {
-                        chargingTime[_index] = _chargingData[_index]->RemainChargingDuration;
+                        chargingTime[_index] = _chargingData[_index]->PresentChargedDuration;
                     }
                     else
                     {
-                        int passTime = _chargingData[_index]->RemainChargingDuration - chargingTime[_index];
+                        int passTime = _chargingData[_index]->PresentChargedDuration - chargingTime[_index];
 
                         if (passTime > 0)
                         {
@@ -3322,7 +3322,7 @@ int main(int argc, char *argv[])
                             }
 
                             _chargingData[_index]->PresentChargedEnergy += changingPow;
-                            chargingTime[_index] = _chargingData[_index]->RemainChargingDuration;
+                            chargingTime[_index] = _chargingData[_index]->PresentChargedDuration;
                         }
                     }
 

+ 2 - 2
EVSE/Projects/DW30/Apps/Module_InternalComm.c

@@ -1855,7 +1855,7 @@ void AcChargeTypeProcess()
                         ac_chargingInfo[0]->PresentChargingPower = (220 * (acChargingCurrent.OuputCurrentL1 / 10)) / 1000;
 
                     ftime(&_ac_endChargingTime);
-                    ac_chargingInfo[0]->RemainChargingDuration = DiffTimeb(_ac_startChargingTime, _ac_endChargingTime);
+                    ac_chargingInfo[0]->PresentChargedDuration = DiffTimeb(_ac_startChargingTime, _ac_endChargingTime);
 
                     // 用以判斷是否有在輸出
                     ac_chargingInfo[0]->IsCharging = acStatus.RelayStatus;
@@ -1882,7 +1882,7 @@ void AcChargeTypeProcess()
                     {
                         gettimeofday(&_ac_charging_comp, NULL);
                         ftime(&_ac_endChargingTime);
-                        ac_chargingInfo[0]->RemainChargingDuration = DiffTimeb(_ac_startChargingTime, _ac_endChargingTime);
+                        ac_chargingInfo[0]->PresentChargedDuration = DiffTimeb(_ac_startChargingTime, _ac_endChargingTime);
                     }
                 }
                     break;

+ 14 - 14
EVSE/Projects/DW30/Apps/Module_LcmControl.c

@@ -612,7 +612,7 @@ void ChangeBattMapAndValue(short page, int soc)
     DisplayValueToLcm(__soc_value_charging, cmd, sizeof(cmd));
 }
 
-void ChangeRemainTime(int sec)
+void ChangeChargingTime(int sec)
 {
     int h, m, s;
     byte cmd[10];
@@ -630,7 +630,7 @@ void ChangeRemainTime(int sec)
     s = (sec - (3600 * h) - (m * 60));
     sprintf((char *)value, "%02d:%02d:%02d", h, m, s);
     string2ByteArray(value, cmd);
-    DisplayValueToLcm(__remain_time_tx, cmd, sizeof(cmd));
+    DisplayValueToLcm(__charging_time_tx, cmd, sizeof(cmd));
 }
 
 void ChangeChargingEnergyValue(float energy)
@@ -908,10 +908,10 @@ void ProcessPageInfo()
                     if (_currentPage == _LCM_CHARGING)
                     {
                         ChangeAcBattMapAndValue(_LCM_CHARGING);
-                        if (ac_chargingInfo[0]->RemainChargingDuration >= 0)
-                            ChangeRemainTime(ac_chargingInfo[0]->RemainChargingDuration);
+                        if (ac_chargingInfo[0]->PresentChargedDuration >= 0)
+                            ChangeChargingTime(ac_chargingInfo[0]->PresentChargedDuration);
                         else
-                            ChangeRemainTime(0);
+                            ChangeChargingTime(0);
 
                         if (ac_chargingInfo[0]->PresentChargingPower >= 0.1)
                             ChangeChargingPowerValue(ac_chargingInfo[0]->PresentChargingPower);
@@ -931,10 +931,10 @@ void ProcessPageInfo()
                     else if (_currentPage == _LCM_COMPLETE)
                     {
                         ChangeAcBattMapAndValue(_LCM_COMPLETE);
-                        if (ac_chargingInfo[0]->RemainChargingDuration >= 0)
-                            ChangeRemainTime(ac_chargingInfo[0]->RemainChargingDuration);
+                        if (ac_chargingInfo[0]->PresentChargedDuration >= 0)
+                            ChangeChargingTime(ac_chargingInfo[0]->PresentChargedDuration);
                         else
-                            ChangeRemainTime(0);
+                            ChangeChargingTime(0);
 
                         if (ac_chargingInfo[0]->PresentChargingPower >= 0.1)
                             ChangeChargingPowerValue(ac_chargingInfo[0]->PresentChargingPower);
@@ -1022,10 +1022,10 @@ void ProcessPageInfo()
                     if (ShmSysConfigAndInfo->SysInfo.CurGunSelected == i)
                     {
                         ChangeBattMapAndValue(_LCM_CHARGING, _chargingInfoData[i]->EvBatterySoc);
-                        if (_chargingInfoData[i]->RemainChargingDuration >= 0)
-                            ChangeRemainTime(_chargingInfoData[i]->RemainChargingDuration);
+                        if (_chargingInfoData[i]->PresentChargedDuration >= 0)
+                            ChangeChargingTime(_chargingInfoData[i]->PresentChargedDuration);
                         else
-                            ChangeRemainTime(0);
+                            ChangeChargingTime(0);
 
                         if (_chargingInfoData[i]->PresentChargingPower >= 0)
                             ChangeChargingPowerValue(_chargingInfoData[i]->PresentChargingPower);
@@ -1048,10 +1048,10 @@ void ProcessPageInfo()
                     if (ShmSysConfigAndInfo->SysInfo.CurGunSelected == i)
                     {
                         ChangeBattMapAndValue(_LCM_COMPLETE, _chargingInfoData[i]->EvBatterySoc);
-                        if (_chargingInfoData[i]->RemainChargingDuration >= 0)
-                            ChangeRemainTime(_chargingInfoData[i]->RemainChargingDuration);
+                        if (_chargingInfoData[i]->PresentChargedDuration >= 0)
+                            ChangeChargingTime(_chargingInfoData[i]->PresentChargedDuration);
                         else
-                            ChangeRemainTime(0);
+                            ChangeChargingTime(0);
 
                         if (_chargingInfoData[i]->PresentChargingPower >= 0)
                             ChangeChargingPowerValue(_chargingInfoData[i]->PresentChargingPower);

+ 2 - 2
EVSE/Projects/DW30/Apps/Module_LcmControl.h

@@ -113,10 +113,10 @@ short __side_mid = 0x0094;
 short __conn_line_chag = 0x0096;
 short __batt_map = 0x0100;
 short __soc_value_charging = 0x0102;
-short __remain_time_map = 0x0106;
+short __charging_time_map = 0x0106;
 short __power_map = 0x0108;
 short __energy_map = 0x010A;
-short __remain_time_tx = 0x0110;
+short __charging_time_tx = 0x0110;
 short __output_eng_tx = 0x0120;
 short __total_out_eng_tx = 0x0130;
 short __conn_line_comp = 0x0140;

+ 10 - 8
EVSE/Projects/DW30/Apps/main.c

@@ -4044,7 +4044,7 @@ bool CheckBackendChargingTimeout(byte gunIndex)
     {
         if (ShmSysConfigAndInfo->SysConfig.MaxChargingDuration > 0)
         {
-            if (chargingInfo[gunIndex]->RemainChargingDuration > (ShmSysConfigAndInfo->SysConfig.MaxChargingDuration * 60))
+            if (chargingInfo[gunIndex]->PresentChargedDuration > (ShmSysConfigAndInfo->SysConfig.MaxChargingDuration * 60))
                 result = true;
         }
     }
@@ -4053,7 +4053,7 @@ bool CheckBackendChargingTimeout(byte gunIndex)
         // 隨插即充電的要看 offline
         if (ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration > 0)
         {
-            if (chargingInfo[gunIndex]->RemainChargingDuration > (ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration * 60))
+            if (chargingInfo[gunIndex]->PresentChargedDuration > (ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration * 60))
                 result = true;
         }
     }
@@ -4455,7 +4455,9 @@ int main(void)
                     {
                         PRINTF_FUNC("S_IDLE================================== %x \n", gun_index);
                         chargingInfo[gun_index]->RemainChargingDuration = 0;
+                        chargingInfo[gun_index]->PresentChargedDuration = 0;
                         chargingInfo[gun_index]->PresentChargedEnergy = 0;
+                        chargingInfo[gun_index]->EvBatterySoc = 0;
                         strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "");
                     }
                     else if (chargingInfo[gun_index]->SystemStatus == S_RESERVATION &&
@@ -4885,7 +4887,7 @@ int main(void)
                         OcppStartTransation(gun_index);
                     }
                     ftime(&endChargingTime[gun_index]);
-                    chargingInfo[gun_index]->RemainChargingDuration = DiffTimeb(startChargingTime[gun_index], endChargingTime[gun_index]);
+                    chargingInfo[gun_index]->PresentChargedDuration = DiffTimeb(startChargingTime[gun_index], endChargingTime[gun_index]);
 
                     if (chargingInfo[gun_index]->Type == _Type_Chademo)
                     {
@@ -4895,7 +4897,7 @@ int main(void)
                             RecordAlarmCode(gun_index, "012234");
                         }
                         else if ((chargingInfo[gun_index]->EvBatterytargetVoltage > 0 && chargingInfo[gun_index]->EvBatterytargetVoltage < SYSTEM_MIN_VOL) ||
-                            (chargingInfo[gun_index]->RemainChargingDuration >= 10 && chargingInfo[gun_index]->PresentChargingVoltage < SYSTEM_MIN_VOL))
+                            (chargingInfo[gun_index]->PresentChargedDuration >= 10 && chargingInfo[gun_index]->PresentChargingVoltage < SYSTEM_MIN_VOL))
                         {
                             // UVP
                             RecordAlarmCode(gun_index, "012289");
@@ -4918,7 +4920,7 @@ int main(void)
                         }
                         else if (isPrechargeStatus_gb(gun_index) == 10 &&
                                  ((chargingInfo[gun_index]->EvBatterytargetVoltage > 0 && chargingInfo[gun_index]->EvBatterytargetVoltage < SYSTEM_MIN_VOL) ||
-                                 (chargingInfo[gun_index]->RemainChargingDuration >= 10 && chargingInfo[gun_index]->PresentChargingVoltage < SYSTEM_MIN_VOL)))
+                                 (chargingInfo[gun_index]->PresentChargedDuration >= 10 && chargingInfo[gun_index]->PresentChargingVoltage < SYSTEM_MIN_VOL)))
                         {
                             // UVP
                             RecordAlarmCode(gun_index, "012290");
@@ -4940,7 +4942,7 @@ int main(void)
                             RecordAlarmCode(gun_index, "012235");
                         }
                         else if ((chargingInfo[gun_index]->EvBatterytargetVoltage > 0 && chargingInfo[gun_index]->EvBatterytargetVoltage < SYSTEM_MIN_VOL) ||
-                                 (chargingInfo[gun_index]->RemainChargingDuration >= 10 && chargingInfo[gun_index]->PresentChargingVoltage < SYSTEM_MIN_VOL))
+                                 (chargingInfo[gun_index]->PresentChargedDuration >= 10 && chargingInfo[gun_index]->PresentChargingVoltage < SYSTEM_MIN_VOL))
                         {
                             // UVP
                             RecordAlarmCode(gun_index, "012288");
@@ -5032,8 +5034,8 @@ int main(void)
                         PRINTF_FUNC ("complete......................... %x \n", gun_index);
                         OcppStopTransation(gun_index);
                         ftime(&endChargingTime[gun_index]);
-                        if (chargingInfo[gun_index]->RemainChargingDuration != 0)
-                            chargingInfo[gun_index]->RemainChargingDuration = DiffTimeb(startChargingTime[gun_index], endChargingTime[gun_index]);
+                        if (chargingInfo[gun_index]->PresentChargedDuration != 0)
+                            chargingInfo[gun_index]->PresentChargedDuration = DiffTimeb(startChargingTime[gun_index], endChargingTime[gun_index]);
 
                         StopGunInfoTimeoutDet(gun_index);
                         StartGunInfoTimeoutDet(gun_index, Timeout_EvseCompleteDet);