Skip to content

Commit

Permalink
Merge branch 'main' of github.com:simatic-ax/axftcmlib
Browse files Browse the repository at this point in the history
  • Loading branch information
sjuergen committed Feb 12, 2024
2 parents 23ba54d + 0c06d4b commit e809e0a
Show file tree
Hide file tree
Showing 18 changed files with 580 additions and 526 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ jobs:
APAX_TOKEN: ${{ secrets.APAX_TOKEN }}
SIMATIC_AX_TOKEN: ${{ secrets.DEPLOY_KEY }}
with:
LOGIN_SIMATIC_AX: true
LOGIN_SIMATIC_AX: true
596 changes: 401 additions & 195 deletions apax-lock.json

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions apax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ variables:
- '--debug'
targets:
- '1500'
- 'axunit-llvm'
# - 'llvm'
- 'llvm'
# Dependencies
devDependencies:
'@ax/sdk': ^4.0.8
"@simatic-ax/snippetscollection": ^0.1.3
'@ax/sdk': 2311.0.1
"@simatic-ax/snippetscollection": 1.0.0

# Registry information, where the package will be published
registries:
Expand All @@ -33,7 +32,7 @@ files:
- 'src'
- 'snippets'
dependencies:
"@ax/simatic-1500-clocks": ^4.0.1
"@simatic-ax/simple-control-modules": ^4.0.1
"@simatic-ax/statemachine": ^4.0.1
"@simatic-ax/io": ^4.0.1
"@ax/simatic-1500-clocks": 6.0.37
"@simatic-ax/simple-control-modules": 5.0.1
"@simatic-ax/io": 5.0.0
"@ax/system-timer": 6.0.94
5 changes: 5 additions & 0 deletions src/Actuator/ActuatorStates.st
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
61 changes: 61 additions & 0 deletions src/Actuator/ActuatorTimeBased.st
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
8 changes: 8 additions & 0 deletions src/Actuator/IActuator.st
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
29 changes: 29 additions & 0 deletions src/ControlModuleAbstract.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ NAMESPACE Simatic.Ax.axftcmlib
END_VAR
VAR PROTECTED
_init : BOOL;
_hasError : BOOL;
_errorState : WORD;
END_VAR

METHOD PUBLIC RunCyclic
Expand All @@ -25,6 +27,33 @@ NAMESPACE Simatic.Ax.axftcmlib
METHOD PROTECTED ABSTRACT _constructor

END_METHOD

METHOD PROTECTED SetError
VAR_INPUT
ErrorCode : WORD;
END_VAR
_errorState := ErrorCode;
_hasError := TRUE;
;
END_METHOD

METHOD PROTECTED SetError
VAR_INPUT
Set : BOOL;
END_VAR
_hasError := Set;
;
END_METHOD

// control module has an error
METHOD PUBLIC HasError : BOOL;
HasError := _hasError;
END_METHOD

METHOD PUBLIC GetErrorStatus : WORD
GetErrorStatus := _errorState;
END_METHOD

END_CLASS

END_NAMESPACE
12 changes: 0 additions & 12 deletions src/Cylinder/IPneumaticCylinder.st

This file was deleted.

114 changes: 0 additions & 114 deletions src/Cylinder/PneumaticCylinder.st

This file was deleted.

11 changes: 0 additions & 11 deletions src/Cylinder/StatePushed.st

This file was deleted.

16 changes: 0 additions & 16 deletions src/Cylinder/StatePushing.st

This file was deleted.

14 changes: 0 additions & 14 deletions src/Cylinder/StateRetract.st

This file was deleted.

11 changes: 0 additions & 11 deletions src/Cylinder/StateRetracted.st

This file was deleted.

18 changes: 0 additions & 18 deletions src/Guards/BinSignalRiseGuard.st

This file was deleted.

21 changes: 0 additions & 21 deletions src/Guards/PLCOpentateGuard.st

This file was deleted.

Loading

0 comments on commit e809e0a

Please sign in to comment.