Owning Palette: VISA Advanced VIs and Functions
Requires: Base Development System
Asynchronously attempts to establish access to the device or interface specified by VISA resource name. Use this function to obtain an exclusive lock that guarantees sole access to a device or resource.
|lock type specifies the type of lock you want to request for the session. You can specify a value of 1 or a 2 to mean an exclusive or shared lock, respectively. The default value is 1. If a session has an exclusive lock, other sessions cannot modify global attributes or invoke operations but still can get attributes and set local attributes. If the session has a shared lock, other sessions that have shared locks also can modify global attributes and invoke operations.|
|VISA resource name specifies the resource to be opened. The VISA resource name control also specifies the session and class.|
|timeout specifies the time, in milliseconds, that the function waits for access to lock.|
|requested key specifies a unique access key for the shared lock. This parameter is valid only if you specify a value of 2 for the lock type parameter.|
|error in describes error conditions that occur before this node runs. This input provides standard error in functionality.|
|VISA resource name out is a copy of the VISA resource name that VISA functions return.|
|access key returns a unique access key for the lock if this VI runs successfully. You then can share the lock by wiring this output to other sessions. access key is valid only if you specify a value of 2 for the lock type parameter.|
|error out contains error information. This output provides standard error out functionality.|
You also can obtain shared locks. The locking mechanism works for all processes and resources that exist on the same computer. Refer to the NI-VISA Help topic on the viLock function for more information about requesting keys and lock sharing.
If a locked VISA session is closed without first being unlocked, VISA automatically performs a VISA Unlock operation on that session, regardless of the type of lock set on the session.