HSL2.0 - Initialisation phase
Content
1.
2.

1.Introduction

Information on the behaviour of HSL2.0 blocks during initialisation and the correct procedure.

During initialisation the blocks are processed. The exact procedure is described in the HTML online help of the HS/FS Expert under "Start behaviour of the logic" (logikstart.html).

With an HSL 2.0 module, the following points/events must be observed, which take place in this order:
It follows that there are situations where HSL2.0 and HSL1.0 blocks behave differently.

2.Example

Logik-Init

The diagram shows a simplified representation of two building blocks that are connected to each other and to several KOs:

2.1.Case 1: Building block B1 is an HSL1.0 building block

In this case the blocks B1 and B2 form a "calculation chain", which is processed from right to left during initialisation. (see already at the beginning mentioned docu "start behaviour of logic")
The values of KO connected to the inputs of block B1 are taken into account and the input of B2 receives the value during initialisation which is present at its output by calculation of block B1.

Conclusion: Module B2 fires exactly once after the end of the entire logic initialisation, namely the value which has been created by calculating the entire "chain".

2.2.Case 2: Block B1 is a HSL2.0 block

Block B1 is instantiated during the initialisation of the logic. At this point it is not possible to describe an output, so the "calculation chain" is interrupted.
In this case, the input of B2 receives the init value of the output of B1 during its initialisation and after completion of the logic initialisation the building block fires. All this takes place in the logic context.
Module B1 is calculated in parallel in the module context, the method on_init() is triggered and it fires. This value is placed in the queue of the logic context.

Conclusion: Block B2 fires once after the end of the logic initialisation, namely the value that was created using the init value from the output of block B1. When the logic queue is processed, block B2 fires a second time, this time using the value that resulted from the calculation of block B1.
Note
If an input is assigned an Init value which can never be received at this input during runtime (the Init value is outside the value range of the KO connected to the input), the value applied to the input can be compared with the Init value during initialisation (in the method on_init()) by means of self.get_input_value() and thus it can be determined whether the input has already been described by the KO before the calculation of the block.