Omron NY532-5400 Reference Manual page 1433

Ny-series
Hide thumbs Also See for NY532-5400:
Table of Contents

Advertisement

Execution priority
High
Low
The priority of T1 is higher than the
priority of T2, so T2 is interrupted
and execution of T1 is started.
T2 executes a Lock instruction with the same Index
value as the Lock instruction in T1. Therefore,
execution of T1 is interrupted until the Unlock
instruction is executed in T2.
Lock regions with different values for Index do not affect each other.
Additional Information
• The Lock and Unlock instructions are used when the same data is read/written from more than one
task. They are used to prevent other tasks from reading/writing the data while a certain task is read-
ing/writing the data.
• As long as the Index values are different, more than one pair of Lock and Unlock instructions can be
placed in the same POU. The instruction pairs can also be nested.
Precautions for Correct Use
• Do not make lock regions any longer than necessary. If the lock region is too long, the task execution
period may be exceeded.
• Always use the Lock and Unlock instructions together as a set in the same section of the same POU.
• You can set a maximum of 16,777,215 lock regions at the same time.
NY-series Instructions Reference Manual (W560)
Task T1
Lock(1)
Task T2
Lock(1)
Unlock(1)
When the Unlock instruction is executed in T2,
execution of T1 is started again, and execution of T2
is interrupted.
2 Instruction Descriptions
Normal execution
Lock region
Execution interrupted.
Unlock(1)
Execution of T2 is started again
after T1 completes execution.
2
2-1381

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents