//-------------------------------------------------------------------------------------------------// public bool StartDCDriveMut(DCDriveMutModes dcDriveMutMode) { const string STRLOG_MethodName = "StartDCDriveMut"; string logMessage = STRLOG_DCDriveMutMode + dcDriveMutMode.ToString(); Logfile.WriteCalled(this.logLevel, STRLOG_ClassName, STRLOG_MethodName, logMessage); this.lastError = null; bool success = false; try { // // Start DC drive // dcDriveMut.SetMainContactorOn(); switch (dcDriveMutMode) { case DCDriveMutModes.EnableOnly: // Don't start the drive break; case DCDriveMutModes.Speed: dcDriveMut.StartDrive(); break; case DCDriveMutModes.Torque: dcDriveMut.StartDriveTorque(); break; } success = true; } catch (Exception ex) { this.lastError = ex.Message; Logfile.WriteError(ex.Message); } logMessage = STRLOG_Success + success.ToString(); Logfile.WriteCompleted(this.logLevel, STRLOG_ClassName, STRLOG_MethodName, logMessage); return(success); }
//-------------------------------------------------------------------------------------------------// public int GetStartDCDriveMutTime(DCDriveMutModes dcDriveMutMode) { int executionTime = 0; executionTime += DCDriveMut.DELAY_SetMainContactorOn; switch (dcDriveMutMode) { case DCDriveMutModes.EnableOnly: // Don't start the drive break; case DCDriveMutModes.Speed: executionTime += DCDriveMut.DELAY_StartDrive; break; case DCDriveMutModes.Torque: executionTime += DCDriveMut.DELAY_StartDriveTorque; break; } return(executionTime); }
//-------------------------------------------------------------------------------------------------// public bool StartDCDriveMut(DCDriveMutModes dcDriveMutMode) { const string STRLOG_MethodName = "StartDCDriveMut"; string logMessage = STRLOG_DCDriveMutMode + dcDriveMutMode.ToString(); Logfile.WriteCalled(this.logLevel, STRLOG_ClassName, STRLOG_MethodName, logMessage); this.lastError = null; bool success = false; try { // // Start DC drive // dcDriveMut.SetMainContactorOn(); switch (dcDriveMutMode) { case DCDriveMutModes.EnableOnly: // Don't start the drive break; case DCDriveMutModes.Speed: dcDriveMut.StartDrive(); break; case DCDriveMutModes.Torque: dcDriveMut.StartDriveTorque(); break; } success = true; } catch (Exception ex) { this.lastError = ex.Message; Logfile.WriteError(ex.Message); } logMessage = STRLOG_Success + success.ToString(); Logfile.WriteCompleted(this.logLevel, STRLOG_ClassName, STRLOG_MethodName, logMessage); return success; }
//-------------------------------------------------------------------------------------------------// public int GetStartDCDriveMutTime(DCDriveMutModes dcDriveMutMode) { int executionTime = 0; executionTime += DCDriveMut.DELAY_SetMainContactorOn; switch (dcDriveMutMode) { case DCDriveMutModes.EnableOnly: // Don't start the drive break; case DCDriveMutModes.Speed: executionTime += DCDriveMut.DELAY_StartDrive; break; case DCDriveMutModes.Torque: executionTime += DCDriveMut.DELAY_StartDriveTorque; break; } return executionTime; }