Bläddra i källkod

[Workaround][DM30][DW30][Relay communication]: For avoid uncorrectly communication data of input voltage message from relay board, which will make the input OVP happens, add workaround to fix it.

2020.06.18 / TC Hsu

Actions: Modify Query_Present_InputVoltage() function, check the checksum of communication message, if the checksum is 0x00, bypass this message. And if the input voltage > 320 V, also bypass it to avoid false input OVP trigger. After uncorrectly message issue from relay board has fixed, this workaround should be removed.

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

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

Files:

	modified:   EVSE/Projects/DM30/Apps/internalComm.c
	modified:   EVSE/Projects/DW30/Apps/internalComm.c
TC_Hsu 4 år sedan
förälder
incheckning
92340ee1a8
2 ändrade filer med 26 tillägg och 6 borttagningar
  1. 13 3
      EVSE/Projects/DM30/Apps/internalComm.c
  2. 13 3
      EVSE/Projects/DW30/Apps/internalComm.c

+ 13 - 3
EVSE/Projects/DM30/Apps/internalComm.c

@@ -156,7 +156,7 @@ unsigned char Query_Present_InputVoltage(unsigned char fd, unsigned char targetA
     unsigned char chksum = 0x00;
     unsigned char len = tranceive(fd, tx, sizeof(tx), rx);
 
-    if(len > 6)
+    if(len > 13)
     {
         if (len < 6+(rx[4] | rx[5]<<8))
             return result;
@@ -168,14 +168,24 @@ unsigned char Query_Present_InputVoltage(unsigned char fd, unsigned char targetA
         if((chksum == rx[6+(rx[4] | rx[5]<<8)]) &&
            (rx[2] == tx[1]) &&
            (rx[1] == tx[2]) &&
-           (rx[3] == tx[3]))
+           (rx[3] == tx[3]) &&
+           chksum != 0)
         {
             Ret_Buf->inputType = rx[6];
             Ret_Buf->L1N_L12 =(rx[7] | (rx[8]<<8))/10.0;
             Ret_Buf->L2N_L23 =(rx[9] | (rx[10]<<8))/10.0;
             Ret_Buf->L3N_L31 =(rx[11] | (rx[12]<<8))/10.0;
 
-            result = PASS;
+            if(Ret_Buf->L1N_L12 >= 320 ||
+               Ret_Buf->L2N_L23 >= 320 ||
+               Ret_Buf->L3N_L31 >= 320)
+            {
+                result = FAIL;
+            }
+            else
+            {
+                result = PASS;
+            }
         }
     }
 

+ 13 - 3
EVSE/Projects/DW30/Apps/internalComm.c

@@ -156,7 +156,7 @@ unsigned char Query_Present_InputVoltage(unsigned char fd, unsigned char targetA
     unsigned char chksum = 0x00;
     unsigned char len = tranceive(fd, tx, sizeof(tx), rx);
 
-    if(len > 6)
+    if(len > 13)
     {
         if (len < 6+(rx[4] | rx[5]<<8))
             return result;
@@ -168,14 +168,24 @@ unsigned char Query_Present_InputVoltage(unsigned char fd, unsigned char targetA
         if((chksum == rx[6+(rx[4] | rx[5]<<8)]) &&
            (rx[2] == tx[1]) &&
            (rx[1] == tx[2]) &&
-           (rx[3] == tx[3]))
+           (rx[3] == tx[3]) &&
+           chksum != 0)
         {
             Ret_Buf->inputType = rx[6];
             Ret_Buf->L1N_L12 =(rx[7] | (rx[8]<<8))/10.0;
             Ret_Buf->L2N_L23 =(rx[9] | (rx[10]<<8))/10.0;
             Ret_Buf->L3N_L31 =(rx[11] | (rx[12]<<8))/10.0;
 
-            result = PASS;
+            if(Ret_Buf->L1N_L12 >= 320 ||
+               Ret_Buf->L2N_L23 >= 320 ||
+               Ret_Buf->L3N_L31 >= 320)
+            {
+                result = FAIL;
+            }
+            else
+            {
+                result = PASS;
+            }
         }
     }