-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
121 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
NAMESPACE Simatic.Ax.axftcmlib | ||
TYPE | ||
ActuatorState : (Retracted, Activating, Activated, Retracting) := Retracted; | ||
END_TYPE | ||
END_NAMESPACE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
USING System.Timer; | ||
USING Simatic.Ax.Io.Output; | ||
|
||
NAMESPACE Simatic.Ax.axftcmlib | ||
|
||
CLASS ActuatorTimeBased | ||
EXTENDS ControlModuleAbstract | ||
IMPLEMENTS IActuator | ||
VAR PUBLIC | ||
ControlPush : IBinOutput; | ||
OnDuration : TIME; | ||
END_VAR | ||
VAR | ||
_tonOnDuration : OnDelay; | ||
_state : ActuatorState; | ||
END_VAR | ||
|
||
METHOD PROTECTED OVERRIDE _constructor | ||
; | ||
END_METHOD | ||
|
||
METHOD PROTECTED OVERRIDE _runCyclicCustom | ||
IF (ControlPush = NULL) THEN | ||
THIS.SetError(WORD#16#8101); | ||
RETURN; | ||
ELSE | ||
THIS.SetError(FALSE); | ||
END_IF; | ||
_tonOnDuration(signal := ControlPush.IsOn(), Duration := OnDuration); | ||
CASE _state OF | ||
ActuatorState#Retracted: | ||
// IF () | ||
ControlPush.SetOff(); | ||
ActuatorState#Activating: | ||
ControlPush.SetOn(); | ||
_state := ActuatorState#Activated; | ||
ActuatorState#Activated: | ||
IF (_tonOnDuration.output) THEN | ||
_state := ActuatorState#Retracting; | ||
ControlPush.SetOff(); | ||
END_IF; | ||
ActuatorState#Retracting: | ||
ControlPush.SetOff(); | ||
_state := ActuatorState#Retracted; | ||
END_CASE; | ||
END_METHOD | ||
|
||
METHOD PUBLIC Enable | ||
_state := ActuatorState#Activating; | ||
END_METHOD | ||
|
||
METHOD PUBLIC Disable | ||
_state := ActuatorState#Retracted; | ||
END_METHOD | ||
|
||
METHOD PUBLIC GetState : ActuatorState | ||
GetState := _state; | ||
END_METHOD | ||
END_CLASS | ||
|
||
END_NAMESPACE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
NAMESPACE Simatic.Ax.axftcmlib | ||
INTERFACE IActuator | ||
METHOD Enable END_METHOD | ||
METHOD Disable END_METHOD | ||
METHOD GetState : ActuatorState | ||
END_METHOD | ||
END_INTERFACE | ||
END_NAMESPACE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.