LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is semaphore support available on PDA?

Hello,
 
    Can any LabVIEW expert please clarify whether semaphore support (eg. Create semaphore, Acquire semaphore) is available on Windows Mobile PDA?
 
    I observed that the example under "labview\examples\general\semaphore.llb" works fine on LabVIEW desktop but doesn't work on PDA. The PDA application using this example builds fine, but doesn't work on PDA i.e. the 'Semaphore User 3' screen comes up on the PDA & no activity is observed (unlike the plots happening on LabVIEW desktop on the 3 user screens). Has anyone come across this problem before?
 
Note: 1. Version of LabVIEW that we are using: LabVIEW 8.5 Professional Development System for Windows Vista/XP/2000 and LabVIEW 8.5 PDA Module for Windows Mobile.
          2. On PDA, the additional tools installed are:
 
Thanks & Regards,
Subhashini
 
0 Kudos
Message 1 of 16
(11,941 Views)
Hello,
 
    I wanted to add the point 2 under 'Note:' as:
2. On PDA, the additional tools installed are: Support for NI-VISA, Shared Variables & PNG Images.
 
PS:   When doing this, i did a mistake & multiple posts of the same query were submitted. I apologise for the inconvenience caused. Is there a way to delete the unwanted (duplicate) posts?
 
Thanks & Regards,
Subhashini
 
0 Kudos
Message 2 of 16
(11,935 Views)

Hi Subhashini,

Try tp post in only one!

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 3 of 16
(11,930 Views)

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").


___________________
Try to take over the world!
0 Kudos
Message 4 of 16
(11,919 Views)

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

 

0 Kudos
Message 5 of 16
(11,753 Views)

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.


___________________
Try to take over the world!
Message 6 of 16
(11,692 Views)

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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 16
(11,625 Views)

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

 

0 Kudos
Message 8 of 16
(8,939 Views)
You can read about AE's here, but here's one highly simplistic example of how this could be done. The subVI code is shown on the right and the release case simply resets the boolean to F. Whether or not this will fit your case depends highly on the requirements, but I would probably implement the limited size queue approach I described earlier.
 
 
To learn more about LabVIEW, I suggest you try looking at some of these tutorials.

___________________
Try to take over the world!
0 Kudos
Message 9 of 16
(8,523 Views)

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

 

0 Kudos
Message 10 of 16
(7,016 Views)