LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Release Semaphore Reference

Solved!
Go to solution

I wrote a simple routine to try to understand how semaphores work (see the attached vi).  In this routine, I have 2 LEDs that I want to blink for 5 sec each (independant of one another).  I assumed the opperation would be the same regardless of which LED blinks first, but that's not the case.  When I first ran the vi, the Release Semaphore Reference vi was connected to the loop 1 Release Semaphore vi.  When my vi ran, loop 2 executed first, and I got run-time error 1111,

 

Possible reason(s):

LabVIEW:  Release Semaphore called on a semaphore that was not currently acquired.


Complete call chain:
     Release Semaphore.vi
     semiphor.vi. 

 

The only way I got it to work was to connect the Release Semaphore Reference vi to the loop 2 Release Semaphore vi (as currently shown).  Can anyone explain and make recommenations?

 

Thanks in advance.

0 Kudos
Message 1 of 2
(4,292 Views)
Solution
Accepted by topic author VI_Joe

The error apperead, because the 'release semaphore reference' was executed before the 'release semaphore'. You should force execution order in a way that 'rsr' is always executed after both 'rs'. I would suggest to use Merge Errors on both loops and pass the merged error in the 'rsr'.

 

Felix

Message 2 of 2
(4,288 Views)