Denso RC5 Specifications Page 432

  • Download
  • Add to my manuals
  • Print
  • Page
    / 692
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 431
14-8
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
Notes on using a CREATESEM instruction:
(1) Phenomena which occur due to wrong usage
If one of the following actions is executed when a program which already
has a semaphore ID created by a CREATESEM instruction is being
executed or suspended and in the wait status, the program with the
semaphore ID will be left in the wait status without being able to obtain a
semaphore.
1) Rewrite a semaphore ID storage variable using CREATESEM.
or,
2) Purposely rewrite the variable from the program pendant.
(2) Example
Start up pro1 and instantaneously stop using the STOP key during
execution of pro2. After that, if the system is restarted, pro3 will wait for a
semaphore indefinitely since the semaphore ID stored in i1 will be
changed.
Page view 431
1 2 ... 427 428 429 430 431 432 433 434 435 436 437 ... 691 692

Comments to this Manuals

No comments