PROGRAM VFD_ErrorMap
IF NOT (VFD_Fault_DriveFault_Code = 0) THEN
	CASE VFD_Fault_DriveFault_Code OF
		2: 	VFD_Fault_Message := 'Auxiliary Input';
		3: 	VFD_Fault_Message := 'Power Loss';
		4: 	VFD_Fault_Message := 'UnderVoltage';
		5: 	VFD_Fault_Message := 'OverVoltage';
		6: 	VFD_Fault_Message := 'Motor Stalled';
		7: 	VFD_Fault_Message := 'Motor Overload';
		8: 	VFD_Fault_Message := 'Heatsink OverTemp';
		9: 	VFD_Fault_Message := 'Control Module OverTemp';
		12: VFD_Fault_Message := 'Hardware OverCurrent';
		13: VFD_Fault_Message := 'Ground Fault';
		15: VFD_Fault_Message := 'Load Loss';
		21: VFD_Fault_Message := 'Output Phase Loss';
		29: VFD_Fault_Message := 'Analog Input Loss';
		33: VFD_Fault_Message := 'Auto Restart Tries Exceeded';
		38: VFD_Fault_Message := 'Phase U Ground Fault';
		39: VFD_Fault_Message := 'Phase V Ground Fault';
		40: VFD_Fault_Message := 'Phase W Ground Fault';
		41: VFD_Fault_Message := 'Phase UV Short';
		42: VFD_Fault_Message := 'Phase UW Short';
		43: VFD_Fault_Message := 'Phase VW Short';
		48: VFD_Fault_Message := 'Parameters Defaulted';
		59: VFD_Fault_Message := 'Safety Open';
		63: VFD_Fault_Message := 'Software OverCurrent';
		64: VFD_Fault_Message := 'Drive Overload';
		70: VFD_Fault_Message := 'Power Unit Failure';
		71: VFD_Fault_Message := 'DSI Network Loss';
		72: VFD_Fault_Message := 'Option Card Network Loss';
		73: VFD_Fault_Message := 'Ethernet Network Loss';
		80: VFD_Fault_Message := 'Autotune Failure';
		81: VFD_Fault_Message := 'DSI Communications Loss';
		82: VFD_Fault_Message := 'Option Card Communications Loss';
		83: VFD_Fault_Message := 'Ethernet Communications Loss';
		91: VFD_Fault_Message := 'Encoder Loss';
		94: VFD_Fault_Message := 'Function Loss';
		100: VFD_Fault_Message := 'Parameter Checksum Error';
		101: VFD_Fault_Message := 'External Storage Failure';
		105: VFD_Fault_Message := 'Control Module Connection Error';
		106: VFD_Fault_Message := 'Incompatible Control Module';
		107: VFD_Fault_Message := 'Replaced Control Module not Recognized';
		109: VFD_Fault_Message := 'Mismatched Control Module';
		110: VFD_Fault_Message := 'Keypad Membrane Failure';
		111: VFD_Fault_Message := 'Safety Hardware Malfunction';
		114: VFD_Fault_Message := 'Microprocessor Failure';
		122: VFD_Fault_Message := 'IO Board Failure';
		125: VFD_Fault_Message := 'Flash Update Required';
		126: VFD_Fault_Message := 'Non-recoverable Firmware Error';
		127: VFD_Fault_Message := 'DSI Flash Update Required';
  END_CASE;
ELSE
	VFD_Fault_Message := 'No Fault';
END_IF;
END_PROGRAM