Skip to main content

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

NameTypeCommentKind
bInitRetainsBOOLif TRUE, the retain variables are initialized (warm start / cold start)input
bInCopyCodeBOOLif TRUE, the instance afterwards gets moved into the copy code (online change)input
contentCNM_AbstractObject.IObject-input
nextCNM_CollectionInterfaces.IDoublyLinkedElement-input
previousCNM_CollectionInterfaces.IDoublyLinkedElement-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;
content :CNM_AbstractObject.IObject;
next :CNM_CollectionInterfaces.IDoublyLinkedElement;
previous :CNM_CollectionInterfaces.IDoublyLinkedElement;
END_VAR
VAR
{attribute 'hide'}
newHashstate3 :CNM_AbstractObject.Hashcode;
END_VAR
VAR CONSTANT
{attribute 'hide'}
NUMBER_OF_LEFT_SHIFTS :UINT := 17;
{attribute 'hide'}
NUMBER_OF_LEFT_ROTATIONS :UINT := 45;
END_VAR

Implementation

THIS^.object := content;
THIS^.next := next;
THIS^.previous := previous;