Skip to content

Commit 2661cd4

Browse files
MBP-247: Simplify STORE_PERSISTENT
1 parent 688a56a commit 2661cd4

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

solution/tc_project_app/POUs/MAIN.TcPOU

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -371,22 +371,12 @@ END_IF
371371
astAxesPersistent[iAxes].fEncoderBiasAtShutdown := afbReadPositionBias[iAxes].Value;
372372
373373
//Store axis status at shutdown
374-
astAxesPersistent[iAxes].bInitialized := GVL.astAxes[iAxes].stStatus.bAxisInitialized;
374+
astAxesPersistent[iAxes].bInitializedAtShutdown := GVL.astAxes[iAxes].stStatus.bAxisInitialized;
375375
astAxesPersistent[iAxes].bHomedAtShutdown := GVL.astAxes[iAxes].stStatus.bHomed;
376-
astAxesPersistent[iAxes].stMotionState := GVL.astAxes[iAxes].Axis.Status.MotionState;
377-
astAxesPersistent[iAxes].bError := GVL.astAxes[iAxes].Axis.Status.Error;
378-
astAxesPersistent[iAxes].nErrorID := GVL.astAxes[iAxes].Axis.Status.ErrorID;
379-
astAxesPersistent[iAxes].bErrorStop := GVL.astAxes[iAxes].Axis.Status.ErrorStop;
380-
astAxesPersistent[iAxes].bStandStill := GVL.astAxes[iAxes].Axis.Status.StandStill;
381-
astAxesPersistent[iAxes].bHasBeenStopped := GVL.astAxes[iAxes].Axis.Status.HasBeenStopped;
382-
astAxesPersistent[iAxes].bDisabled := GVL.astAxes[iAxes].Axis.Status.Disabled;
383-
astAxesPersistent[iAxes].bMoving := GVL.astAxes[iAxes].Axis.Status.Moving;
384-
385-
astAxesPersistent[iAxes].nCycles := astAxesPersistent[iAxes].nCycles + 1;
386-
astAxesPersistent[iAxes].fPositionDifference := ABS(afCurrentPosition[iAxes] - astAxesPersistent[iAxes].fPositionAtShutdown);
376+
astAxesPersistent[iAxes].fPositionDifferenceAtShutdown := ABS(afCurrentPosition[iAxes] - astAxesPersistent[iAxes].fPositionAtShutdown);
387377
388378
//Store value of moving at shutdown
389-
IF GVL.astAxes[iAxes].Axis.Status.Disabled OR astAxesPersistent[iAxes].fPositionDifference < fPositionDifferenceLimit THEN
379+
IF astAxes[iAxes].Axis.Status.Disabled OR astAxesPersistent[iAxes].fPositionDifferenceAtShutdown < fPositionDifferenceLimit THEN
390380
astAxesPersistent[iAxes].bMovingAtShutdown := FALSE;
391381
ELSE
392382
astAxesPersistent[iAxes].bMovingAtShutdown := TRUE;

0 commit comments

Comments
 (0)