FB_reinit
If required, you have to implement FB_reinit explicitly. If this method is present, it is called automatically after the instance of the corresponding function block has been copied (implicit call). This happens during an Online Change after changes to the function block declaration (signature change) to reinitialize the new instance block.
Explicit calling is not recommended The methods FB_init, FB_reinit and FB_exit are system functions that are called implicitly at different times (further information on this can be found under Operating cases). Explicitly calling these methods can have inadvertent consequences and is therefore not recommended. |
Automatic core dump on exception in FB_init/FB_reinit/FB_exit If an exception error occurs within the FB_init/FB_reinit/FB_exit code, e.g. due to a programming error, the runtime system automatically stores a core dump on the target system (from TC3.1 Build 4024.25). This core dump is stored as a *.core file in the boot folder of the target system (by default under C:\TwinCAT\3.1\Boot\Plc) and can be used for the search of causes. For more information on loading a core dump, see: Error analysis with core dump |
Interface of the method FB_reinit
METHOD FB_reinit : BOOL
Return value
Implicit calls
If the methods are called implicitly the return value will not be evaluated by the system. Even if you adjust the return value, it will not be evaluated with an implicit call.
Explicit calls
If the methods are called explicitly you can evaluate the return value. You can thus return a meaningful return value.
FB_reinit with derived function blocks
To reinitialize the basic implementation of the function block, FB_reinit must be called explicitly for the basic function block (via SUPER^.FB_reinit()
). The return value can be evaluated.