Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

exclusive lock of GPIB or GPIB-ENET hardware by means of NI VISA

I have found in NI Developer Zone
http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B123AE0CBCC8111EE034080020E74861&p_node=DZ52350&p_source=External

a document "How to use iblock/ibunlock with the GPIB-ENET/100 under LabVIEW" and a example ftp://ftp.ni.com/contrib/epd/B123AE0CBCC9111EE034080020E74861/iblock.vi

This example works great but I have to use a tricky way for communicate with instruments. I have in mind that it is impossible to use VISA address. It is necessary to set listener and so on.

Is there any way how to to obtain exclusive lock of the GPIB or GPIB-ENET hardware and continue using VISA address as well as any instrument drivers, which require VISA address?

Tha
nks in advance.
0 Kudos
Message 1 of 4
(3,569 Views)
Hello,

The reason that the example works the way it does is because it does a viLock on the GPIB0::INTFC VISA resource (the entire ENET box) rather than doing a lock on the GPIB0::n::INSTR resource (the specific instrument). You must lock the interface if you want to keep all other applications/processes/computers from accessing the ENET itself. The downside of locking the interface is that you must then use board-level commands to address the bus because you have only opened the board resource rather than the device resource. There is no way around this.

If you only require exclusive access to a particular instrument, you can viLock that specific instrument's resource which will allow you to use "normal" read and write operations without addressin
g the bus since you are talking directly to that specific device.

If you must have an exclusive lock on the ENET interface as well as communicate using "normal" VISA read and VISA write VI's, let me know. There may be a solution involving calling iblck() from the 488.2 library and then doing a VISA Open on the resource as long as these two function calls are executed from the same process.

Scott B.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 4
(3,569 Views)
Dear Scott B.

thank you for your assistance very much. To tell the truth I would like to execute exclusive lock on NI PCI-GPIB board. There are several computer that use PCI-GPIB board like ENET-GPIB converter. For several reasons it is a good idea to use exclusive lock to prevent GPIB collisions.

Is it possible to get exclusive lock if I using C# and NI Studio for .Net?


Mikhail Kozlov
0 Kudos
Message 3 of 4
(3,569 Views)
Scott B.,

I have a similar situation where three computers share the same ENET-GPIB. The applications on the PCs use the .NET VISA Library to access the instruments on the GPIB.

Is it possible for 1 PC to exclusively lock one particular instrument, preventing the other 2 from using it?

The other 2 PCs should still have access to other instruments on the ENET-GPIB.

On one PC, I tried LockResource(..) in a GpibSession with 1 instrument, but that didn't prevent one of the other PCs from using that instrument.

Thanks,

Alfred
0 Kudos
Message 4 of 4
(3,569 Views)