FB_init
Short summary
The constructor FB_init is needed to create an unique hash code.
The hash code is a pseudo random number create with a xorshift algorithm.
It can be overwritten on derivations, because it will be called implicit, SUPER^.FB_init() is not required.
For more information check: Behavoir with derived function blocks.
- Return type:
BOOL
Parameters
| Name | Type | Comment | Kind |
|---|---|---|---|
| bInitRetains | BOOL | if TRUE, the retain variables are initialized (warm start / cold start) | input |
| bInCopyCode | BOOL | if TRUE, the instance afterwards gets moved into the copy code (online change) | input |
| tree | REFERENCE TO BalancedBinarySearchTree | The tree that should be iterated, can be 0 | input |
Code
Declaration
METHOD FB_init : BOOL
VAR_INPUT
(* if TRUE, the retain variables are initialized (warm start / cold start)*)
bInitRetains : BOOL;
(* if TRUE, the instance afterwards gets moved into the copy code (online change) *)
bInCopyCode : BOOL;
(*The tree that should be iterated, can be 0*)
tree :REFERENCE TO BalancedBinarySearchTree;
END_VAR
Implementation
THIS^.tree REF= tree;
IF THIS^.isObjectValid(tree) THEN
THIS^.nodeList.append(THIS^.root);
THIS^.currentNode := THIS^.root;
END_IF