Denso RC5 Specifications Page 437

  • Download
  • Add to my manuals
  • Print
  • Page
    / 692
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 436
Chapter 14 Multitasking Control Statements
14-13
TAKESEM (Statement)
Function
Obtains a semaphore with a designated semaphore ID.
Format
TAKESEM <Semaphore ID>[,<Timeout time>]
Explanation
This statement obtains the semaphore designated in <Semaphore ID>.
If another task obtains a semaphore, the system waits for the semaphore to be
released before the semaphore is obtained.
Waiting time can be designated in milliseconds (ms) using the option <Timeout
time>. If the system cannot obtain a semaphore within the designated time, an
error occurs.
Related Terms
CREATESEM, DELETESEM, FLUSHSEM, GIVESEM
Example
DEFINT Li1Li2Li3=1
Li1 = CREATESEM(Li3) '
Creates a semaphore with the queuing system designated in Li3
'and the semaphore ID obtained in Li1.
Li2 = CREATESEM(Li3)
'Creates a semaphore with the queuing system designated in Li3
'and the semaphore ID obtained in Li2.
TAKESEM Li1 'Obtains the semaphore designated in Li1.
TALESEM Li2100 '
Obtains the semaphore designated in Li1. However, a timeout
'occurs after 100 ms.
RUN samp1
GIVESEM Li1 'Releases one task from the wait status which has the
semaphore
'designated in Li1.
FLUSHSEM Li2 '
Releases all tasks from the wait status which have the
semaphore
'designated in Li2.
DELETESEM Li1 '
Deletes the semaphore with the semaphore ID designated in Li1.
DELETESEM Li2 '
Deletes the semaphore with the semaphore ID designated in Li2.
Notes
When the timeout time option is used, note that the waiting time elapses even
in suspension after an instantaneous stop of the robot during execution of an
instruction and a subsequent restart of the robot.
Page view 436
1 2 ... 432 433 434 435 436 437 438 439 440 441 442 ... 691 692

Comments to this Manuals

No comments