LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is semaphore support available on PDA?

I did work with queues on the PDA, but I didn't use limited size queues and I don't have currently access to the PDA module, so I can't test anything. The best suggestion I have is that you use an alternative implementation like the LV2 style global, but that does not work in exactly the same way.

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

Hello,

    Thanks for ur response, tst. I will try the LV2 style global method.

    Has anyone got this (synchronisation of VI execution) working on PDA? If yes, what was the method used? Actually, what i need is this: The same Sub-VI (what we have developed) gets called in multiple parallel running loops of a LabVIEW application & hence some mutex is needed in this Sub-VI to avoid getting clobbered. I hope i have made myself clear...I need to get this working asap.

Thanks & Regards,

Subhashini

 

0 Kudos
Message 12 of 16
(4,930 Views)

If the VI contains all the code it needs, then it serves as a mutex without needing anything else.

By default, any VI is reused whereever it's called, so that if it is called from more than one place at the same time, the other places will wait until the first call was finished.
Unless you explicitly change the VI to be reentrant, it will continue to behave like this, so it's already mutexed, but this comes with the important condition that all the code must be inside the subVI.


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

Hello tst,

    The mutex is needed because the Sub-VI accesses hardware & it is necessary that the Sub-VI does not execute at the same time when it is called from multiple loops. I feel that the behaviour of the VI is different from what you have said, so i guess it doesn't have all the necessary code.

Thanks & Regards,

Subhashini

 

0 Kudos
Message 14 of 16
(4,890 Views)

Here's an example - the subVI has a 2 seconds wait.

As you can see, this causes the loops to alternate, because when one loop is inside the subVI, the other loop has to wait until the call is finished. This guarantees a lock and I believe it should work the same on the PDA. If you put all your hardware calls inside the subVI, it should be protected.


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

Hello All,

    Wanted to share this news with u all:

1. When i replaced the 'Release Semaphore_71.vi' call with 'Release Semaphore.vi' call, the application on PDA works ok!:) But i found some issues - Sometimes, on a 'Acquire Semaphore' call or 'Release Semaphore' call, the application crashes.:(

2. I found that the 'semaphores' & 'queues' work better in the actual application on PDA rather than the LabVIEW semaphore example programs!

Thanks & Regards,

Subhashini

 

0 Kudos
Message 16 of 16
(1,349 Views)