10-02-2009 09:32 AM
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.
Solved! Go to Solution.
10-02-2009 09:42 AM
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