################################################## # Calculate the rolling average of In-use PCDU BDR Converter Input Current # # This is for BDR1_Conv1 # # Note - 2 Global Variables are used # VAR_dummyA := NPWD4768; #Changes every packet, needed for OL to update VAR_dummyB := NPWT4768; #Changes every packet, needed for OL to update # # PCDU-A in use if NCSD0PC4.raw == 2 then VAR_curr := NPWD4752; else #Else PCDU-B in-use if NCSD0PD4.raw == 2 then VAR_curr := NPWT4752; else VAR_curr := 0; # No PCDU in use....? endif; endif; # GVAR_NPWx4752cnt := GVAR_NPWx4752cnt + 1; GVAR_NPWx4752sum := GVAR_NPWx4752sum + VAR_curr; # GVAR_NPWx4752sum / GVAR_NPWx4752cnt;