/// <summary> /// Attempts to retrieve the Psu Status. This method /// calls down to the Chassis Manager with SendReceive /// </summary> private PsuStatusPacket GetPsuStatus(byte psuId) { // Initialize return packet PsuStatusPacket returnPacket = new PsuStatusPacket(); returnPacket.CompletionCode = CompletionCode.UnspecifiedError; returnPacket.PsuStatus = 0; returnPacket.FaultPresent = false; try { PsuStatusResponse myResponse = new PsuStatusResponse(); myResponse = (PsuStatusResponse)this.SendReceive(this.PsuDeviceType, this.PsuId, new PsuRequest((byte)PmBusCommand.STATUS_WORD, (byte)PmBusResponseLength.STATUS_WORD), typeof(PsuStatusResponse)); if (myResponse.CompletionCode != 0) { returnPacket.CompletionCode = (CompletionCode)myResponse.CompletionCode; Tracer.WriteWarning("GetPsuStatus Failure for PSU {0}: Completion Code: {1}", psuId, myResponse.CompletionCode); } else { returnPacket.CompletionCode = CompletionCode.Success; byte varStatus; byte[] psuStatus = myResponse.PsuStatus; // If there are any other faults, indicate fault is present and log the full status word if (!PmBus.ExtractPowerGoodFromPsuStatus(psuStatus, out varStatus)) { Tracer.WriteWarning("GetPsuStatus: Psu ({0}) STATUS_WORD is non-zero: " + "(High Byte: {1} Low Byte: {2}) (See STATUS_WORD register in PmBusII Manual)", this.PsuId, System.Convert.ToString(psuStatus[1], 2).PadLeft(8, '0'), System.Convert.ToString(psuStatus[0], 2).PadLeft(8, '0')); returnPacket.FaultPresent = true; } returnPacket.PsuStatus = varStatus; } } catch (System.Exception ex) { returnPacket.CompletionCode = CompletionCode.UnspecifiedError; returnPacket.PsuStatus = 0; Tracer.WriteError("GetPsuStatus Exception: " + ex); } return(returnPacket); }
/// <summary> /// Attempts to retrieve the Psu Status. This method /// calls down to the Chassis Manager with SendReceive /// </summary> private PsuStatusPacket GetPsuStatus(byte psuId) { // Initialize return packet PsuStatusPacket returnPacket = new PsuStatusPacket(); returnPacket.CompletionCode = CompletionCode.UnspecifiedError; returnPacket.PsuStatus = 0; try { PsuStatusResponse myResponse = new PsuStatusResponse(); myResponse = (PsuStatusResponse)this.SendReceive(this.PsuDeviceType, this.PsuId, new PsuRequest((byte)PmBusCommand.STATUS_WORD, (byte)PmBusResponseLength.STATUS_WORD), typeof(PsuStatusResponse)); if (myResponse.CompletionCode != 0) { returnPacket.CompletionCode = (CompletionCode)myResponse.CompletionCode; Tracer.WriteWarning("GetPsuStatus Failure: status({0})", returnPacket.PsuStatus); } else { returnPacket.CompletionCode = CompletionCode.Success; byte varStatus; byte[] psuStatus = myResponse.PsuStatus; // If there are any other faults, print the full status word if (!PmBus.ExtractPowerGoodFromPsuStatus(psuStatus, out varStatus)) { Tracer.WriteWarning("Psu({0}) PowerGood Negated ({1} {2}) in/out curr/volt faults (See StatusWord in PmBusII Manual)", this.PsuId, System.Convert.ToString(psuStatus[0], 2).PadLeft(8, '0'), System.Convert.ToString(psuStatus[1], 2).PadLeft(8, '0')); } returnPacket.PsuStatus = varStatus; } } catch (System.Exception ex) { returnPacket.CompletionCode = CompletionCode.UnspecifiedError; returnPacket.PsuStatus = 0; Tracer.WriteError("GetPsuStatus Exception: " + ex); } return(returnPacket); }
/// <summary> /// Attempts to retrieve the Psu Status. This method /// calls down to the Chassis Manager with SendReceive /// </summary> private PsuStatusPacket GetPsuStatus(byte psuId) { // Initialize return packet PsuStatusPacket returnPacket = new PsuStatusPacket(); returnPacket.CompletionCode = CompletionCode.UnspecifiedError; returnPacket.PsuStatus = 0; returnPacket.FaultPresent = false; try { PsuStatusResponse myResponse = new PsuStatusResponse(); myResponse = (PsuStatusResponse)this.SendReceive(this.PsuDeviceType, this.PsuId, new PsuRequest((byte)PmBusCommand.STATUS_WORD,(byte)PmBusResponseLength.STATUS_WORD), typeof(PsuStatusResponse)); if (myResponse.CompletionCode != 0) { returnPacket.CompletionCode = (CompletionCode)myResponse.CompletionCode; Tracer.WriteWarning("GetPsuStatus Failure for PSU {0}: Completion Code: {1}", psuId, myResponse.CompletionCode); } else { returnPacket.CompletionCode = CompletionCode.Success; byte varStatus; byte[] psuStatus = myResponse.PsuStatus; // If there are any other faults, indicate fault is present and log the full status word if (!PmBus.ExtractPowerGoodFromPsuStatus(psuStatus, out varStatus)) { Tracer.WriteWarning("GetPsuStatus: Psu ({0}) STATUS_WORD is non-zero: " + "(High Byte: {1} Low Byte: {2}) (See STATUS_WORD register in PmBusII Manual)", this.PsuId, System.Convert.ToString(psuStatus[1], 2).PadLeft(8, '0'), System.Convert.ToString(psuStatus[0], 2).PadLeft(8, '0')); returnPacket.FaultPresent = true; } returnPacket.PsuStatus = varStatus; } } catch (System.Exception ex) { returnPacket.CompletionCode = CompletionCode.UnspecifiedError; returnPacket.PsuStatus = 0; Tracer.WriteError("GetPsuStatus Exception: " + ex); } return returnPacket; }
/// <summary> /// Attempts to retrieve the Psu Status. This method /// calls down to the Chassis Manager with SendReceive /// </summary> private PsuStatusPacket GetPsuStatus(byte psuId) { // Initialize return packet PsuStatusPacket returnPacket = new PsuStatusPacket(); returnPacket.CompletionCode = CompletionCode.UnspecifiedError; returnPacket.PsuStatus = 0; try { PsuStatusResponse myResponse = new PsuStatusResponse(); myResponse = (PsuStatusResponse)this.SendReceive(this.PsuDeviceType, this.PsuId, new PsuRequest((byte)PmBusCommand.STATUS_WORD,(byte)PmBusResponseLength.STATUS_WORD), typeof(PsuStatusResponse)); if (myResponse.CompletionCode != 0) { returnPacket.CompletionCode = (CompletionCode)myResponse.CompletionCode; Tracer.WriteWarning("GetPsuStatus Failure: status({0})", returnPacket.PsuStatus); } else { returnPacket.CompletionCode = CompletionCode.Success; byte varStatus; byte[] psuStatus = myResponse.PsuStatus; // If there are any other faults, print the full status word if (!PmBus.ExtractPowerGoodFromPsuStatus(psuStatus, out varStatus)) { Tracer.WriteWarning("Psu({0}) PowerGood Negated ({1} {2}) in/out curr/volt faults (See StatusWord in PmBusII Manual)", this.PsuId, System.Convert.ToString(psuStatus[0], 2).PadLeft(8, '0'), System.Convert.ToString(psuStatus[1], 2).PadLeft(8, '0')); } returnPacket.PsuStatus = varStatus; } } catch (System.Exception ex) { returnPacket.CompletionCode = CompletionCode.UnspecifiedError; returnPacket.PsuStatus = 0; Tracer.WriteError("GetPsuStatus Exception: " + ex); } return returnPacket; }