Priority

Description:              This function sets the execution priority for a module, variable or object.

Returns:                    Nothing

Usage:                       Script

Format:                      Priority(Data, PriorityNum)

Parameters:             Data    { varies }  { required }  { no default: }

                                      The module, variable, or object value to set the priority for.

                             PriorityNum    { numeric }  { required }  { no default: }

                                      A numeric value that sets the priority as indicated:

PriorityNum

Priority

0

Normal

1

High

2

Default

 

                             Default priority is only valid for modules and variables; it causes variables to assume the priority of the instance in which they occur.

Comments:               This function sets the execution priority for a value so that any statements which use that value will execute before other statements triggered from normal priority values. If Priority is applied to a module, all instances of that module will have that priority unless otherwise set. Priority for an object value will set all values in an instance and all module instances called from that instance to that priority unless otherwise set. Setting priority for a variable will set the priority for all instances of that variable and will override the priority setting of the module or instance in which it is contained.

                             Priority can be used to improve the performance of I/O drivers, alarm modules, control modules and other modules for which increased responsiveness is required. Use Priority sparingly since its results are only effective if there are non-priority values which can be preempted to improve the performance.

                             This function returns the previous priority of the object.

Example:

prevPriority = Priority(Self(), 1);

This sets the priority of the module that contains this statement to a high priority.

See Also:

Pending | PriorityWeight