LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Semaphore

hi
I am just trying to learn the use of semaphore. in my application i am making a VI just same as the inbuild example given in Labview. When I stopped the Main VI  then the two sub  vi were also stopped but with an error message code : 1111 ,  description : Release Semaphore.vi.
I am not getting the reason for this  error message
 
I am attaching the code.Please help me on this issue.
Thanxs
Raman 
0 Kudos
Message 1 of 6
(3,861 Views)
You can get the reason with Help->Explain error menu item and writing the error code into the proper control. Error 1111 means that the code is trying to release a semaphore that was not acquired. I can't say more because I only have LV 7.1

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 6
(3,849 Views)

Hi

Thanxs for reply. But the attached zip file semaphore.vi is same as given in the Labview help Semaphore with SudVIs. I am not able to find the bug. please help.

 

Raman

0 Kudos
Message 3 of 6
(3,822 Views)
The example is working well for me (7.1). Did you change something in the example vis? If you did, please repost all vis saved for 7.1 (File->Save with options): I didn't install LV8 yet.

Paolo

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 6
(3,819 Views)

Hi Paolo

Thanxs for reply.

You just check the error output of both the sub VIs .For me it is showing Error having code 1111

Raman

 

 

0 Kudos
Message 5 of 6
(3,809 Views)
Raman,
I can see why this example is so confusing. It is actually working "correctly", that is, it is working according to the way it was designed. The way that the program shuts down is by detecting an error. If you look in the example, you'll see a comment that says "Destroy semaphore (this will stop the subVIs)". This works because once the semaphore is destroyed, it can no longer be locked or unlocked. This generates an error in the 2 subvis which are programmed to stop the while loops on errors. You'll actually notice that an error occurs at both the acquire (error 1)  and release semaphore vis (error 1111). This is very much by design, although very confusing.
 
Chris C
0 Kudos
Message 6 of 6
(3,790 Views)