omron — PROCEED program instruction

PRIORITY real-valued function PRIORITY real-valued function Syntax PRIORITY Function Return the current reaction lock-out priority for the program. Usage Considerations The name "priority" cannot be used as a program name or variable name. This function returns the reaction lock-out priority, not the program priority of the executing program. Details The reaction lock-out priority for each program task is set to zero when execution of the task is initiated. The priority can be changed by the program at any time with the LOCK instruction, or the priority is set automatically when a reaction occurs as prescribed by a REACT or REACTI instruction.

The PRIORITY function can be used to determine the current setting of the reaction lock-out priority for the task executing the function. Example This example raises the priority, performs some operation that requires a reaction routine to be locked out, and then restores it to its previous value. save = PRIORITY ;Save the current priority IF save 10 THEN ;Raise priority to at least 10 LOCK 10 END ; Access data shared by a reaction routine. LOCK save ;Set priority to original value Related Keywords LOCK program instruction REACT program instruction REACTI program instruction PROCEED program instruction eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 408