Skip to main content

run

Short Summary

This method calls the logic for the HMI.

Attention: This methods needs to be called in every PLC cycle.

Parameters

none

Code

Declaration

METHOD run
VAR_INST
currentStep: DINT := 0;
END_VAR

Implementation

THIS^.cycleManager(execute := TRUE);
IF (THIS^.nodeSelectionChanged := THIS^.selectedNode <> THIS^.currentNode) THEN
THIS^.currentNode := THIS^.selectedNode;
THIS^.nextOpMode := THIS^.currentOpMode := THIS^.selectedNode.currentModeId;
END_IF

CASE THIS^.cycleManager.step.current OF
INIT:
THIS^.initButtons();
THIS^.nextOpMode := OpMode.HOME;

THIS^.cycleManager.evaluate(
SEL(
THIS^.modeHandler.isSwitchedOn,
CNM_ReturnTypes.SingleExecutionState.BUSY,
CNM_ReturnTypes.SingleExecutionState.SUCCESS
));
SELECT_MODE:
THIS^.cycleManager.proceedWith(step := THIS^.selectModeStep());
START_MODE:
THIS^.cycleManager.proceedWith(step := THIS^.startModeStep());
RUN_MODE:
THIS^.cycleManager.proceedWith(step := THIS^.runModeStep());
STOP_MODE_IMMEDIATE:
THIS^.cycleManager.proceedWith(step := THIS^.stopModeImmediateStep());
STOP_MODE_REQUEST:
THIS^.cycleManager.proceedWith(step := THIS^.stopModeRequestStep());
ELSE
; // do nothing
END_CASE

THIS^.messageService.run();