Semaphore Property (ADriver) |
v8 |
Returns a semaphore object which can be used to control access to shared resources.
[ ob = ] Object.Semaphore ( )
The Parameters property syntax has the following parts:
Name |
Type |
Description |
Object |
ADriver |
ADriver object |
ob |
Semaphore object |
The Semaphore property can be used to synchronize access to a driver when running multiple UUTs in parallel mode or when using multi-threads to access the driver. If using it to synchronize between different process set the name of the semaphore to a unique system wide from both process.
The following example locks the DMM before taking a DC measurement. If the semaphore is already locked by another thread, the function will wait until unlocked (from the other thread) and then will take the measurement.
DMM.Semaphore.Lock()
DMM Set Function VDC
DMM Measure (TestResult)
DMM.Unlock()
AProgram.Semaphore, ASystem.Semaphore