Attribute ‘call_before_global_exit_slot’ΒΆ

Hint

VAR_INPUT declarations in functions or methods that use the attribute lead to compile errors. Reason: Input variables are unknown in this case at the time of the call, which occurs implicitly during the online change.

The effect of this pragma is that all functions and programs containing this attribute in a dedicated first line of their declaration are called before the GlobalExit. The GlobalExit takes place before a new download or a reset. Function blocks provided with an FB_Exit method are affected. The order of calling is defined by means of the attribute value.

Syntax:

{attribute 'call_before_global_exit_slot' := '<slot>'}

Insert location: First line above the declaration part of functions and programs.

<slot>: Integer value that defines the ranking in the order of the calls; the lower the value, the earlier the call takes place. If several function blocks have the same ranking for the attribute, then the order of their calls remains indefinite.

If a method possesses the attribute, then the method is called for all instances of the function block concerned. CODESYS calls all instances in the specified slot. In this case you have no influence on the order of the instances among themselves.

See also