diff --git a/BaseComponents.tsproj b/BaseComponents.tsproj index b80a879..483499a 100644 --- a/BaseComponents.tsproj +++ b/BaseComponents.tsproj @@ -136,7 +136,7 @@ - + BasicComponents Instance {08500001-0000-0000-F000-000000000064} diff --git a/BasicComponents.library b/BasicComponents.library index fcde18e..733211a 100644 Binary files a/BasicComponents.library and b/BasicComponents.library differ diff --git a/BasicComponents/POUs/Components/AxisPTP/FB_AxisPTP.TcPOU b/BasicComponents/POUs/Components/AxisPTP/FB_AxisPTP.TcPOU index 7fa3bf0..61f2d5d 100644 --- a/BasicComponents/POUs/Components/AxisPTP/FB_AxisPTP.TcPOU +++ b/BasicComponents/POUs/Components/AxisPTP/FB_AxisPTP.TcPOU @@ -212,9 +212,6 @@ IF _fbHalt.Error THEN _xError := TRUE; END_IF -// Can the axis perform a new move command -_xCanExecNewCmd := (NOT _xBusy) AND _fbPower.Status AND (NOT _xError); - // ==================== // Handle state machine // ==================== @@ -224,6 +221,7 @@ CASE _eState OF IF xEnable THEN _xEnable := TRUE; _xBusy := TRUE; + _xDone := FALSE; _eState := E_AXIS_PTP_STATE.WAIT_FOR_ENABLE; END_IF @@ -248,18 +246,15 @@ CASE _eState OF E_AXIS_PTP_STATE.ENABLED: - _xDone := FALSE; IF _xExecuteMoveAbs THEN _xExecuteMoveAbs := FALSE; - _xBusy := TRUE; _xStartMoveAbsolute := TRUE; _eState := E_AXIS_PTP_STATE.MOVING_ABSOLUTE; END_IF IF _xExecuteMoveRel THEN _xExecuteMoveRel := FALSE; - _xBusy := TRUE; _xStartMoveRelative := TRUE; _eState := E_AXIS_PTP_STATE.MOVING_RELATIVE; END_IF @@ -267,27 +262,25 @@ CASE _eState OF IF _xExecuteHoming THEN _xExecuteHoming := FALSE; _xStartHomeing := TRUE; - _xBusy := TRUE; _eState := E_AXIS_PTP_STATE.HOMING; END_IF IF _xExecuteMoveVelocity THEN _xExecuteMoveVelocity := FALSE; _xStartMoveVelocity := TRUE; - _xBusy := TRUE; _eState := E_AXIS_PTP_STATE.MOVING_VELOCITY; END_IF IF _xExecuteMoveModulo THEN _xExecuteMoveModulo := FALSE; _xStartMoveModulo := TRUE; - _xBusy := TRUE; _eState := E_AXIS_PTP_STATE.MOVING_MODULO; END_IF IF (NOT xEnable) AND (NOT _xError) THEN _xEnable := FALSE; _xBusy := TRUE; + _xDone := FALSE; _eState := E_AXIS_PTP_STATE.WAIT_FOR_DISABLE; END_IF @@ -452,6 +445,8 @@ CASE _eState OF _xError := TRUE; END_CASE +// Can the axis perform a new move command +_xCanExecNewCmd := (NOT _xBusy) AND _fbPower.Status AND (NOT _xError); // Copy internal buffers to outputs xEnabled := _fbPower.Status; @@ -469,6 +464,10 @@ END_VAR]]> @@ -480,10 +479,17 @@ VAR_INPUT END_VAR]]>