Skip to content

Commit

Permalink
Merge pull request #369 from ix-ax/library-target-selector
Browse files Browse the repository at this point in the history
Simplifies usage of REF_TO AxoStep
The most significant changes involve the simplification of variable usage and the reorganization of variable declarations. The variables _refBeforeStep, _refCurrentStep, and _refAfterStep were replaced with a single variable _refStep, which is now used for all three steps. This change was reflected in the method where these steps are set. Additionally, the variable _closeCycleCounter was repositioned in the variable declarations.

Necessary because when built for 1500 targets the library reported an error at compilation (REF_TO AxoStep already in use). Not sure about the reason, but simplifying serves the purpose.
  • Loading branch information
PTKu committed Apr 11, 2024
2 parents d280947 + 984203d commit c283578
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/core/ctrl/src/AxoCoordination/AxoSequencer/AxoSequencer.st
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ NAMESPACE AXOpen.Core
_coordinatorState : AxoCoordinatorStates;
_step : IAxoStep;
_openCycleCounter : ULINT;
_closeCycleCounter : ULINT;
_refBeforeStep : REF_TO AxoStep;
_refCurrentStep : REF_TO AxoStep;
_refAfterStep : REF_TO AxoStep;
_closeCycleCounter : ULINT;
_refStep : REF_TO AxoStep;
_microStep : UINT;
END_VAR

Expand Down Expand Up @@ -170,18 +168,18 @@ NAMESPACE AXOpen.Core
END_IF;

IF(THIS.CurrentOrder = step.GetStepOrder()) THEN
_refCurrentStep ?= step;
CurrentStep := _refCurrentStep^;
_refStep ?= step;
CurrentStep := _refStep^;
END_IF;

IF(THIS.CurrentOrder + ULINT#1 = step.GetStepOrder() OR (THIS.CurrentOrder = THIS.GetNumberOfConfiguredSteps() AND step.GetStepOrder() = UINT#1)) THEN
_refAfterStep ?= step;
AfterStep := _refAfterStep^;
_refStep ?= step;
AfterStep := _refStep^;
END_IF;

IF(THIS.CurrentOrder - ULINT#1 = step.GetStepOrder() OR (THIS.CurrentOrder = UINT#1 AND step.GetStepOrder() = THIS.GetNumberOfConfiguredSteps())) THEN
_refBeforeStep ?= step;
BeforeStep := _refBeforeStep^;
_refStep ?= step;
BeforeStep := _refStep^;
END_IF;
END_METHOD

Expand Down

0 comments on commit c283578

Please sign in to comment.