|
@@ -45,6 +45,10 @@ namespace CyberX8_RT.Devices.AXIS.GalilLipsel
|
|
|
/// Stop Position
|
|
|
/// </summary>
|
|
|
private GalilRotationStopPositionRoutine _stopPositionRoutine;
|
|
|
+ /// <summary>
|
|
|
+ /// Axis StopOperation Locker
|
|
|
+ /// </summary>
|
|
|
+ private readonly object _stopOperationLocker = new object();
|
|
|
#endregion
|
|
|
/// <summary>
|
|
|
/// 构造函数
|
|
@@ -87,12 +91,16 @@ namespace CyberX8_RT.Devices.AXIS.GalilLipsel
|
|
|
{
|
|
|
return true;
|
|
|
}
|
|
|
- _currentOperation = MotionOperation.StopPosition;
|
|
|
- if (_profilePositionRoutine.Monitor() == RState.Running)
|
|
|
+ lock (_stopOperationLocker)
|
|
|
{
|
|
|
- _profilePositionRoutine.Abort();
|
|
|
- }
|
|
|
- _status = _stopPositionRoutine.Start();
|
|
|
+ _currentOperation = MotionOperation.StopPosition;
|
|
|
+ if (_profilePositionRoutine.Monitor() == RState.Running)
|
|
|
+ {
|
|
|
+ _profilePositionRoutine.Abort();
|
|
|
+ }
|
|
|
+ _status = _stopPositionRoutine.Start();
|
|
|
+ }
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -242,18 +250,21 @@ namespace CyberX8_RT.Devices.AXIS.GalilLipsel
|
|
|
}
|
|
|
else if (_currentOperation == MotionOperation.StopPosition)
|
|
|
{
|
|
|
- RState state = _stopPositionRoutine.Monitor();
|
|
|
- if (state == RState.End)
|
|
|
+ lock (_stopOperationLocker)
|
|
|
{
|
|
|
- EndOperation();
|
|
|
- _status = RState.End;
|
|
|
- }
|
|
|
- else if (state == RState.Failed || state == RState.Timeout)
|
|
|
- {
|
|
|
- EndOperation();
|
|
|
- _status = RState.Failed;
|
|
|
- LOG.WriteLog(eEvent.ERR_AXIS, $"{Module}.{Name}", "StopPosition error");
|
|
|
- }
|
|
|
+ RState state = _stopPositionRoutine.Monitor();
|
|
|
+ if (state == RState.End)
|
|
|
+ {
|
|
|
+ EndOperation();
|
|
|
+ _status = RState.End;
|
|
|
+ }
|
|
|
+ else if (state == RState.Failed || state == RState.Timeout)
|
|
|
+ {
|
|
|
+ EndOperation();
|
|
|
+ _status = RState.Failed;
|
|
|
+ LOG.WriteLog(eEvent.ERR_AXIS, $"{Module}.{Name}", "StopPosition error");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
JudgeRunMonitor();
|