##################################################
# Calculate the rolling average of In-use PCDU BDR Converter Input Current
#
# This is for BDR2_Conv1
#
# Note - 2 Global Variables are used
#
VAR_dummyA := NPWD4776; #Changes every packet, needed for OL to update
VAR_dummyB := NPWT4776; #Changes every packet, needed for OL to update
#
# PCDU-A in use
if NCSD0PC4.raw == 2 then
	VAR_curr := NPWD4760;
else
	#Else PCDU-B in-use
	if NCSD0PD4.raw == 2 then
		VAR_curr := NPWT4760;
	else
		VAR_curr := 0; # No PCDU in use....?
	endif;
endif;
#
GVAR_NPWx4760cnt := GVAR_NPWx4760cnt + 1;
GVAR_NPWx4760sum := GVAR_NPWx4760sum + VAR_curr;
#
GVAR_NPWx4760sum / GVAR_NPWx4760cnt;