Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

VISA Equivalents for the GPIB-ENET's IBLOCK and IBUNLOCK Functions

Hardware: GPIB>>External Controllers/Convertors>>GPIB-ENET

Problem: I am using a GPIB-ENET box and making VISA function calls to it. Can I lock out other users from the ENET box automatically through VISA? I know that National Instruments has the iblock and ibunlock functions for GPIB, but I was wondering if there were VISA equivalents, and if so, could they be automatically invoked whenever a VISA session is started with a specific GPIB-ENET box?

Solution: The answer is yes and no. VISA has locking with viLock and viUnlock. It works similarly to the NI-488 locking.

However, in the old version (NI-VISA 2.01) VISA locks do not prevent NI-488 users from using it. VISA locks work fine, but only if all users of that GPIB-ENET box are using VISA. In the current version of VISA (NI-VISA 2.5) the VISA locks will internally call the NI-488 iblock function, so that you can mix and match NI-VISA and NI-488 applications and the locking will be consistent across both.

For the final question, yes, you can lock upon opening a VISA session. Pass 1 (VI_EXCLUSIVE_LOCK) as the accessMode parameter. If viOpen returns successfully, that session has a lock and no other session can use that resource. (Although other VISA sessions can be opened without a lock, they cannot get a lock or do anything useful such as I/O.)

Related Links: KnowledgeBase 1RHCPQPH: Locking and Unlocking a GPIB-ENET

Attachments:





Report Date: 09/24/1999
Last Updated: 04/12/2002
Document ID: 1PNH90V8

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit