Lock And Unlock - Omron NY532-5400 Reference Manual

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

Advertisement

2 Instruction Descriptions

Lock and Unlock

Lock:
Starts an exclusive lock between tasks. Execution of any other task with a lock region
with the same lock number is disabled.
Unlock:
Stops an exclusive lock between tasks.
Instruction
Lock
Lock Tasks
Unlock
Unlock Tasks
Variables
Name
Meaning
Index
Lock
number
Out
Return
value
Bit strings
Index
Out
OK
Function
The Lock and Unlock instructions create lock regions. If a lock region in one task is being executed, the
lock regions with the same lock number in other tasks are not executed. Specify the lock number with
Index.
The following figure shows a programming example.
Both task T1 and task T2 contain a lock region with Index set to 1. If the Lock instruction in T2 is exe-
cuted first, the lock region in T1 is not executed until the Unlock instruction is executed in T2.
2-1380
Name
FB/FUN
FUN
FUN
I/O
Description
Input
Lock number
Output
Always TRUE
OK
Graphic expression
(@)Lock
EN
ENO
Index
Out
(@)Unlock
EN
ENO
Index
Out
Valid range
Depends on data type.
TRUE only
Integers
NY-series Instructions Reference Manual (W560)
ST expression
Lock(Index);
Unlock(Index);
Unit
Default
---
0
---
---
Times, durations,
dates, and text strings

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents