Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Remote VISA and Lock resource

I have noticed that unlike for local serial ports, remote ports using VISA Server (visa://machine...) (VISA 3.1) can be used by two application simultaneously (LabVIEW 7.1 apps). To disallow that I have set the applications to lock their resources (VISA Lock Async.vi).

My questions are:
Is the unlocked resource the intended behavior?
Is the resource implicitly unlocked with VISA Close or Application Exit or is a Unlock explicitly required?


LabVIEW, C'est LabVIEW

Message 1 of 2
(3,947 Views)
Jean Pierre--

When you use the VISA Lock Async.vi to lock a resource, operations invoked by other sessions to the same resource are serviced or returned with a locking error, depending on the operation and the type of lock used.

If a session has an exclusive lock, other sessions cannot modify global attributes or invoke operations, but can still get attributes and set local attributes. If the session has a shared lock, other sessions that have shared locks can also modify global attributes and invoke operations. Regardless of which type of lock a session has, if the session is closed without first being unlocked, VISA automatically performs a viUnlock() on that session. 

The locking mechanism works for all processes and resources existing on the same computer.  When using remote resources, however, the networking protocol may not provide the ability to pass lock requests to the remote device or resource. In this case, locks will behave as expected from multiple sessions on the same computer, but not necessarily on the remote device. For example, when using the VXI-11 protocol, exclusive lock requests can be sent to a device, but shared locks can only be handled locally.

Mark
Message 2 of 2
(3,935 Views)