Acquires access to a semaphore.

Use this VI in conjunction with the other Semaphore VIs to implement a semaphore in LabVIEW.


icon

Inputs/Outputs

  • cdlrn.png semaphore

    semaphore is a reference to a semaphore.

  • ci32.png ms timeout (-1)

    ms timeout specifies how many milliseconds the function should wait for the semaphore to become available.

    The default is -1, indicating never to time out.

  • cerrcodeclst.png error in (no error)

    error in describes error conditions that occur before this node runs. With the following exception, this input provides standard error in functionality.

    This node runs normally even if an error occurred before this node runs.

  • idlrn.png semaphore out

    semaphore out has the same value as semaphore.

  • ibool.png timed out

    timed out is TRUE if the semaphore did not become available before the function timed out or if an error occurred.

  • ierrcodeclst.png error out

    error out contains error information. This output provides standard error out functionality.

  • If the semaphore is already acquired by the maximum number of tasks, the VI waits ms timeout milliseconds before timing out. If the semaphore becomes available during the wait, timed out is FALSE. If the semaphore does not become available or semaphore is not valid, timed out is TRUE. The count on a semaphore is incremented each time Acquire Semaphore executes, even if the task acquiring the semaphore has already acquired it once.

    Examples

    Refer to the following example files included with LabVIEW.

    • labview\examples\Synchronization\Semaphore\Simple Semaphore.vi