I am making my first attempt at using semaphores,and am getting error 1111 when I go to release the semaphore. I have read several posts on this error, but saw none that seem to offer a solution. As you can see, I created a semaphore with a size of 1, and I have wired in a -1 to the timeout of the acquire semaphore. How did the release get executed without the semaphore being acquired?
You aren't showing us all of your code. In your create image, the semaphore reference wire is being branched to somewhere else. Where and what is going on there?
If you happened to release a semaphore that has already been released somewhere else, you'll get this error message.
Hi Ravens Fan,
My code is a bit too large to upload. I have 2 parallel loops. The top loop (next to the obtain semaphore reference) is my event structure. The timeout event checks the status of my hardware (temperature, pressure etc.) to protect the system when idling. The lower "main loop" is where all of the production sequence is. As both loops need to talk to the same modules, I added the semaphore. I thought that with a semaphore of size 1 I could avoid this problem.