f



How do I create Labview VISA ports for *individual* GPIB instruments using Prologix USB GPIB controller?

Hello,

I'm trying to use a Prologix USB GPIB controller to control GPIB
instruments, and I would like to have a virtual serial (VISA) port for
*each instrument*, as is the case with a normal GPIB controller with a
standard NI driver.  However this is not what the Prologix driver
provides -- it provides a single VISA virtual serial port for the
entire controller.  To address the instrument with GPIB address 11,
you first send "++addr 11" to the serial port, and then you're talking
to instrument 11.  However, this means I have to change all old
Labview programs.

Is it possible to create a "wrapper" function of some kind that will
define a virtual serial (VISA) port for each *instrument* on the
controller?  For example, to talk to GPIB instrument 11, call it
ASRL3::11::INSTR, each time it is written to it would have to write to
the virtual serial port of the controller, say ASRL3::INSTR, first "+
+addr 11" and then the command that is sent to it.

A clearer explanation of the difference (i.e. incompatibility), and of
my objective:
1) A normal GPIB controller with NI driver:  I go to the NI
Measurement & Instrumentation Panel, under GPIB, and Scan for
Instruments; all the live instruments show up; subsequently when I
want to use Labview programs that use VISA ports, the VISA drop boxes
allow me to choose a different port for each instrument, e.g.
"GPIB0::11::INSTR", "GPIB0::12::INSTR" would be instruments at
addresses GPIB 11 and GPIB 12.

2) The Prologix GPIB controller that plugs into a USB port:  In
Labview you get a *single* VISA virtual serial port, ASRL3::INSTR, for
the entire GPIB0 controller.  Therefore to address GPIB instrument 11,
you write "++addr 11" to the virtual serial port ASRL3::INSTR, and
then you are communicating with device 11, so you can write and read
ASRL3::INSTR to talk to that device.  Then to talk to device GPIB 12,
you write "++addr 12" to the same VISA port, and then you are talking
to that device.  The problem is that this requires recoding all
Labview code, whereas I would like to be able to use the same program
either with a normal or with a Prologix GPIB controller.  Therefore, I
would like to create code that scans the controller for all GPIB
attached devices and creates VISA ports for all.  Such ports, when
written to, would have to first write "++addr DEVICENUM" to
ASRL3::INSTR (i.e. the port of the GPIB-USB controller) where
DEVICENUM is the GPIB address of the instrument corresponding to that
port, and then would have to do a write or read or whatever function
is being done on that instrument VISA port.

I haven't figured out if it is possible to do this easily.  Help and
pointers on where to look for hints would be much appreciated.  Many
thanks!

Milos
0
milos (16)
8/2/2008 4:40:20 AM
comp.lang.labview 35210 articles. 1 followers. vasusachin24 (1) is leader. Post Follow

2 Replies
5845 Views

Similar Articles

[PageSpeed] 22

Hi Milos, you can use the Mathc Pattern function to split your string. After that you can use a loop to execute the commands you need.Hope it helps.Mike
0
x9561 (148439)
8/2/2008 5:40:18 AM
My first impression is that if you don't want to make any changes at all to existing programs is that the wrapper you need is one around VISA. You would need to intercept all of the calls into the NI VISA driver. If you create your own visa32.dll and in there, change the addressing and then call the real VISA driver, you might (repeat, might) get something to work. If this would even work, you still might find that you have to make significant changes anyway. The serial connection is going to be considerably slower, and interface specific functions such as service request handling, bus triggering of multiple instruments, etc., would be difficult to impossible. This would be a lot of work, imho, to just save a couple of hundred dollars over a real GPIB controller. I've seen this Prologix device before and have even used NI's RS-232->GPIB controller. The Prologix intended use to me seems to me more for a hobbyist or very casual user. Of course, I'm used to having multiple GPIB instruments worth 10s/100s of thousands of dollars and the cost of an fully compliant GPIB controller is just lost in the noise.
0
x9561 (148439)
8/2/2008 5:40:16 PM
Reply: