11-11-2010 01:32 PM
This is my first attempt at using semaphores. I thought I understood them, but I am not getting the results I expected. The program has two parallel loops. In the top one is an event structure that takes in user actions, and in the timeout loop checks pump status every 250ms. The bottom loop performs the test. Because both loops need to talk to the same cDAQ module, I was getting conflict errors. I added the semaphore to eliminate that. What I am seeing is that the For Loop on the bottom starts to perform it's function (therefore should have the semaphore locked) and then the check pump status in the timeout structure will throw an error. How can it execute while the bottom loop has the semaphore locked? (The true case in the timeout event is empty)
11-11-2010 04:01 PM
Put a probe or an indicator on the boolean line coming out of the Timed Out? of the upper acquire semaphore to see if it is returning the timeout. If that one is timed out, then you Check Pump Status should never be executing in that case of the case structure.