Skip to main content

setMode

short summary

This method sets a mode for the rootnode or, if specified, for a single node and its subnodes. It is only allowed to overwrite the mode if the rootNode or the specified node is not in busy state.

legal notes

| SPDX-FileCopyrightText: © 2024 ekvip automation GmbH <info@ekvip.de> | SPDX-License-Identifier: Apache-2.0 | For details check: Apache-2.0_

.. _Apache-2.0: https://www.apache.org/licenses/LICENSE-2.0

.. </legal notes>

example

set it for the whole machine:

myOpmodeHandler.setMode(
mode := automaticMode
);

overwrite the mode of specified node:

myOpmodeHandler.setMode(
mode := serviceMode,
node := despensingUnit
);

Parameters

NameTypeCommentKind
modeIModeBehaviourthe mode instance that should be setinput
nodeIModeNodeoptionally: a specified node in the tree that is not the subtree (if 0, the rootNode will be adressed)input

Code

Declaration

METHOD setMode : CNM_ReturnTypes.SingleExecutionResult
VAR_INPUT
(* the mode instance that should be set *)
mode : IModeBehaviour;
(* optionally: a specified node in the tree that is not the subtree (if 0, the rootNode will be adressed) *)
node : IModeNode := 0;
END_VAR