//-------------------------------------------------------------------------------------------------// public int GetStopACDriveTime(ACDriveModes acDriveMode) { int executionTime = 0; switch (acDriveMode) { case ACDriveModes.NoLoad: executionTime += ACDrive.DELAY_StopDrive; break; case ACDriveModes.FullLoad: executionTime += ACDrive.DELAY_StopDriveFullLoad; break; case ACDriveModes.LockedRotor: executionTime += ACDrive.DELAY_StopDrive; break; case ACDriveModes.SynchronousSpeed: executionTime += ACDrive.DELAY_StopDrive; break; } executionTime += this.GetConfigureACDriveTime(); executionTime += ACDrive.DELAY_DisableDrivePower; return(executionTime); }
//-------------------------------------------------------------------------------------------------// public bool StartACDrive(ACDriveModes acDriveMode) { const string STRLOG_MethodName = "StartACDrive"; string logMessage = STRLOG_ACDriveMode + acDriveMode.ToString(); Logfile.WriteCalled(STRLOG_ClassName, STRLOG_MethodName, logMessage); this.lastError = null; bool success = false; try { // // Start the AC drive // switch (acDriveMode) { case ACDriveModes.NoLoad: acDrive.ConfigureSpeed(ACDrive.MAXIMUM_Speed); acDrive.StartDriveNoLoad(); break; case ACDriveModes.FullLoad: acDrive.StartDriveFullLoad(); break; case ACDriveModes.LockedRotor: acDrive.StartDriveLockedRotor(); break; case ACDriveModes.SynchronousSpeed: acDrive.ConfigureSpeed(ACDrive.MAXIMUM_Speed); acDrive.StartDriveSyncSpeed(); break; } success = true; } catch (Exception ex) { this.lastError = ex.Message; Logfile.WriteError(ex.Message); } logMessage = STRLOG_Success + success.ToString(); Logfile.WriteCompleted(STRLOG_ClassName, STRLOG_MethodName, logMessage); return(success); }
//-------------------------------------------------------------------------------------------------// public bool StopACDrive(ACDriveModes acDriveMode) { const string STRLOG_MethodName = "StopACDrive"; Logfile.WriteCalled(STRLOG_ClassName, STRLOG_MethodName); this.lastError = null; bool success = false; try { // // Stop AC drive // switch (acDriveMode) { case ACDriveModes.NoLoad: acDrive.StopDriveNoLoad(); break; case ACDriveModes.FullLoad: acDrive.StopDriveFullLoad(); break; case ACDriveModes.LockedRotor: acDrive.StopDriveLockedRotor(); break; case ACDriveModes.SynchronousSpeed: acDrive.StopDriveSyncSpeed(); break; } // // Disable drive power // acDrive.DisableDrivePower(); success = true; } catch (Exception ex) { this.lastError = ex.Message; Logfile.WriteError(ex.Message); } string logMessage = STRLOG_Success + success.ToString(); Logfile.WriteCompleted(STRLOG_ClassName, STRLOG_MethodName, logMessage); return(success); }
//-------------------------------------------------------------------------------------------------// public bool StopACDrive(ACDriveModes acDriveMode) { const string STRLOG_MethodName = "StopACDrive"; Logfile.WriteCalled(STRLOG_ClassName, STRLOG_MethodName); this.lastError = null; bool success = false; try { // // Stop AC drive // switch (acDriveMode) { case ACDriveModes.NoLoad: acDrive.StopDriveNoLoad(); break; case ACDriveModes.FullLoad: acDrive.StopDriveFullLoad(); break; case ACDriveModes.LockedRotor: acDrive.StopDriveLockedRotor(); break; case ACDriveModes.SynchronousSpeed: acDrive.StopDriveSyncSpeed(); break; } // // Disable drive power // acDrive.DisableDrivePower(); success = true; } catch (Exception ex) { this.lastError = ex.Message; Logfile.WriteError(ex.Message); } string logMessage = STRLOG_Success + success.ToString(); Logfile.WriteCompleted(STRLOG_ClassName, STRLOG_MethodName, logMessage); return success; }
//-------------------------------------------------------------------------------------------------// public bool StartACDrive(ACDriveModes acDriveMode) { const string STRLOG_MethodName = "StartACDrive"; string logMessage = STRLOG_ACDriveMode + acDriveMode.ToString(); Logfile.WriteCalled(STRLOG_ClassName, STRLOG_MethodName, logMessage); this.lastError = null; bool success = false; try { // // Start the AC drive // switch (acDriveMode) { case ACDriveModes.NoLoad: acDrive.ConfigureSpeed(ACDrive.MAXIMUM_Speed); acDrive.StartDriveNoLoad(); break; case ACDriveModes.FullLoad: acDrive.StartDriveFullLoad(); break; case ACDriveModes.LockedRotor: acDrive.StartDriveLockedRotor(); break; case ACDriveModes.SynchronousSpeed: acDrive.ConfigureSpeed(ACDrive.MAXIMUM_Speed); acDrive.StartDriveSyncSpeed(); break; } success = true; } catch (Exception ex) { this.lastError = ex.Message; Logfile.WriteError(ex.Message); } logMessage = STRLOG_Success + success.ToString(); Logfile.WriteCompleted(STRLOG_ClassName, STRLOG_MethodName, logMessage); return success; }
//-------------------------------------------------------------------------------------------------// public int GetStopACDriveTime(ACDriveModes acDriveMode) { int executionTime = 0; switch (acDriveMode) { case ACDriveModes.NoLoad: executionTime += ACDrive.DELAY_StopDrive; break; case ACDriveModes.FullLoad: executionTime += ACDrive.DELAY_StopDriveFullLoad; break; case ACDriveModes.LockedRotor: executionTime += ACDrive.DELAY_StopDrive; break; case ACDriveModes.SynchronousSpeed: executionTime += ACDrive.DELAY_StopDrive; break; } executionTime += this.GetConfigureACDriveTime(); executionTime += ACDrive.DELAY_DisableDrivePower; return executionTime; }