NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use lock in TestStand for synchronization ?

I am trying to implement the synchronizing techniques for the COM component. Through the document, I understood about Lock utility. But it was not clear that how should I release lock. Can anybody guide me in this issue ? My requirement is, even though 2-3 sequnces try to access same COM component, only one sequence should be able to access the COM component. Other sequences will wait till this time.
0 Kudos
Message 1 of 3
(6,291 Views)
After you create a TestStand lock using the Lock step type, you can then acquire the lock using the Lock operation of the Lock step type. When using the Lock operation of the step type, you have the option to specify the Lock Operation Lifetime. Options for this are:
-Same as Sequence
-Same as Thread
-Use ActiveX reference

The first two options are fairly explanatory; acquire lock until either the sequence or thead completes.


The last option allows you to store an ActiveX reference to the lock operation in a TestStand variable. You can release the lock operation by setting this variable to value of Nothing (e.g. Locals.MyLock = Nothing). Or, you can release the lock by letting the variable go out of scope.


Finally, you can release a lock using a Loc
k step configured for the Early Unlock operation. This allows you to release a lock before than the lifetime you configured when creating the lock.


Hope this helps.
0 Kudos
Message 2 of 3
(6,291 Views)
Nemo,

How can I do this from within a CVI DLL and not a TestStand expression? I am setting a lock in TestStand, but I need to unlock it from within the DLL.

Thanks,

Brian
0 Kudos
Message 3 of 3
(6,291 Views)