You can use this pragma to influence the order in which signatures are processed during global initialization. It can only be applied to signatures.Β
By default, the initialization sequence for variables from global variable lists is undefined!
However, if, for example, variables from one list depend on variables from another list, it is necessary to initialize one before the other.
(Aee OLH and Syntax) The placeholder <slot> must be replaced by an integer value that defines the position in the initialization sequence.</slot>
The default value is 50000.
A lower value causes an earlier initialization!
If several signatures have the same value for the 'global_init_slot' attribute, the order of their initialization remains undefined!Β
Cautious application should therefore be considered!
Example: The project contains f.e. two global variable lists GVL_1 and GVL_2. The global variable "A" is part of the global variable list GVL_1:
So if you set the 'global_init_slot' attribute of the global variable list GVL_1 to 300, i.e. to the lowest initialization value in the example, then it is ensured that the expression "A+1" is well-defined at the time of initialization of "B".
Last edit: r-niedermayer 2024-01-30
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
After updating from SP18 to SP19 I am receiving multiple C0564 warning messages after I compile. Does anyone know how to fix the warnings?
Please see or Online Help on how to initialize variable before using them:
https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_pragma_attribute_global_init_slot.htmlΒ
Regarding the Attribute global_init_slot:
You can use this pragma to influence the order in which signatures are processed during global initialization. It can only be applied to signatures.Β
By default, the initialization sequence for variables from global variable lists is undefined!
However, if, for example, variables from one list depend on variables from another list, it is necessary to initialize one before the other.
(Aee OLH and Syntax) The placeholder <slot> must be replaced by an integer value that defines the position in the initialization sequence.</slot>
The default value is 50000.
A lower value causes an earlier initialization!
If several signatures have the same value for the 'global_init_slot' attribute, the order of their initialization remains undefined!Β
Cautious application should therefore be considered!
Example: The project contains f.e. two global variable lists GVL_1 and GVL_2. The global variable "A" is part of the global variable list GVL_1:
The initialization values of the variables "B" and "C" of GVL_2 are dependent on the variable "A".
So if you set the 'global_init_slot' attribute of the global variable list GVL_1 to 300, i.e. to the lowest initialization value in the example, then it is ensured that the expression "A+1" is well-defined at the time of initialization of "B".
Last edit: r-niedermayer 2024-01-30
Thank you for the reply. I was able to use this attribute in both of my Network Variable List Sends to clear the warnings.