Skip to main content

BaseHmi

Short Summary

This class is a concrete HMI handler implementation for the mandatory operation modes Automatic, Homing and Manual. It also takes care for managing alarms and messages.

AccessAbstractFinalExtendsImplements
-NoNoAbstractHmi-

UML Diagram

Parameters

none

Properties

className

Type: CNM_AbstractObject.ClassName

This property returns the class name of the concrete object,

selectedNode

Type: CNM_OpModeHandlingInterfaces.INode

step

Type: BOOL

This property setter sends the step signal to all nodes of the machine.

Methods

FB_Exit

  • Parameters:
    • bInCopyCode (BOOL): TRUE: the exit method is called in order to leave the instance which will be copied afterwards (online change).
  • Return type: BOOL

FB_Exit must be implemented explicitly. If there is an implementation, then the

FB_init

  • Parameters:
    • bInitRetains (BOOL): if TRUE, the retain variables are initialized (warm start / cold start)
    • bInCopyCode (BOOL): if TRUE, the instance afterwards gets moved into the copy code (online change)
    • modeHandler (CNM_OpModeHandlingInterfaces.IOpModeHandler): operation mode handler for the station
    • customModeConditions (CNM_OpModeHandlingInterfaces.IModeConditionProvider): custom mode condition, if set to 0, default conditions will be used
  • Return type: BOOL

The constructor FB_init is needed to create an unique hash code.

getMode

  • Parameters:
    • selectedMode (UDINT): use the enum ''OpMode'', e.g. OpMode.AUTOMATIC
  • Return type: CNM_OpModeHandlingInterfaces.IModeBehaviour

This method returns the mandatory operation modes depending on the selected operation mode.

initButtons

  • Return type: VOID

This method initializes the Buttons for the HMI (all visible, all disabled).

run

  • Return type: VOID

This method calls the logic for the HMI.

runModeStep

  • Return type: DINT

This method monitors the current operation mode and stops it, if the operator reuqests a stop (or stop request) or the mode is done.

selectModeStep

  • Return type: DINT

This method routes the operation mode selected from the HMI to the operation mode handler.

startModeStep

  • Return type: DINT

This method starts the operation mode if the start button from the HMI is pressed.

stopModeImmediateStep

  • Return type: DINT

This method stops the operation mode immediately if the stop button from the HMI was pressed.

stopModeRequestStep

  • Return type: DINT

This method stops the operation mode via stop request if the stop request button from the HMI was pressed.

Code

Declaration

FUNCTION_BLOCK BaseHmi EXTENDS AbstractHmi
VAR
messageService :CNM_MessageServices.GlobalMessageService;
cycleManager :CNM_CycleManager.SimpleCycleManager;
conditionProvider :CNM_OpModeHandlingInterfaces.IModeConditionProvider;
defaultConditions :POINTER TO DefaultModeConditions;
currentNode :CNM_OpModeHandlingInterfaces.INode;
hmiSelectedNode :CNM_OpModeHandlingInterfaces.INode;
selectedNodeAddress :POINTER TO __XWORD := ADR(hmiSelectedNode);
selectedNodeRaw :__XWORD;
enableModeSelection :BOOL := TRUE;
nodeSelectionChanged :BOOL;
END_VAR
VAR CONSTANT
INIT :DINT := CNM_ReturnTypes.DefaultSteps.STEP.INIT;
SELECT_MODE :DINT := INIT + 1;
START_MODE :DINT := SELECT_MODE + 1;
RUN_MODE :DINT := START_MODE + 1;
STOP_MODE_IMMEDIATE :DINT := RUN_MODE + 1;
STOP_MODE_REQUEST :DINT := STOP_MODE_IMMEDIATE + 1;
END_VAR