02-14-2008 05:50 AM
02-14-2008 06:07 AM
02-14-2008 06:19 AM
Hi Subhashini,
Try tp post in only one!
02-14-2008 06:36 AM
Semaphores are based on CINs, so I'm a little surprised it even compiled, but I guess that means that the CIN code was portable.
If you want, you can duplicate the functionality of semaphores using limited size queues - the Create VI should be replace with a VI which creates a queue with the same size as the semaphore and then fills the queue in a for loop. The acquire is performed by dequeuing an element and the release is performed by enqueuing an element. Since the queue has a fixed size, dequeuing the last element will cause any other VI which wants to dequeue to wait until there is an element in the queue (which happens when you "release").
02-14-2008 10:54 PM
Hello tst,
Thanks for ur response. Can u please point me to an example which shows how this could be done on the PDA? What i actually need is that i want to mutually exclude the execution of 2 parallel sub-VIs i.e. Only after one VI finishes execution, the other VI should execute & vice-versa (just as shown in the LabVIEW semaphore example). Is there any other method to achieve this?
Thanks & Regards,
Subhashini
02-15-2008 04:03 AM
As I said, it's fairly simple to do using queues, but I don't have a specific example. The description in the last post should be enough.
If I understand what you want correctly, however, you can probably just do this with a simple LV2 style global with a boolean output. You can create three actions for it - Lock, Release and "Read and Lock if free". Lock and release will change the value to T or to F. This won't work exactly the same as semaphores, since you will need to poll it when you're waiting to run the second VI, but it is also fairly simple to implement.
02-15-2008 08:52 AM
I'd like to second tst's suggestion to use LV2's (Action Engines). THis is the approach we have used on PDA's.
Re: The Semaphores
I can't say how I know this but I believe the semaphores are functional on the PDA but NI has not exposed these for our use.
Ben
02-23-2008 04:50 AM
Hello Ben / tst,
Thanks for ur response. It would be good if u could send me an example showing how to use LV2's (Action Engines) on PDA to mutually exclude execution of 2 VIs, because i'm quite new to LabVIEW development.
Ben, as i mentioned earlier, i tried the example semaphore program of LabVIEW on PDA (which builds fine) but it did not work, which means semaphores are not functional on the PDA?
Thanks & Regards,
Subhashini
02-24-2008 07:08 AM

02-28-2008 08:57 AM
Hello tst,
Thanks for ur response again. I wanted to first test the limited size queue approach on PDA with sample programs. I modified the semaphore example program of LabVIEW to use queues instead of semaphores as per your suggestion & this works fine on desktop. But i find that this also does not work as desired on PDA. Only when there is a execution delay of about 3 seconds or more in the SubVIs that do 'Deque / Enque Element', the program works on PDA. Even with a delay of 1 second, this does not work as desired on PDA. I have attached the modified VIs for ur reference. Please note that the names of VIs still have a 'Semaphore...' prefix.
Has any LabVIEW expert got queues working on PDA?
Thanks & Regards,
Subhashini