Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to connect Agilent 33220A with Ni Visa 3.0.1 strough USB?

as title.
I have follwed the README.TXT in VISA 3.0.1 to install the USBTMC driver.
The
MAX can deteced this USBTMC, but can not use viWrite nor viRead to send
the
command to this USBTMC device(Agilent 33220A). Could you help to solve this

problem? Which USBTMC device will be used to verify VISA 3.0.1 ?
0 Kudos
Message 1 of 9
(6,142 Views)
Can you tell more about the problem/symptom?
(1) Does the instrument go to REMOTE state after viWrite was invoked?
(2) What is the ViStatus code returned from viWrite and viRead?
(3) Do other functions such as viClear or viReadSTB work fine?
(4) Is the instrument really hosted by NI's USBTMC device driver? You can check this in the Control Panel | Device Manager tab.

Hope this helps.
Makoto
0 Kudos
Message 2 of 9
(6,142 Views)
my testing results
(1)No.

(2)I use the MAX's Open VISA session to test the connection. I have no idea where the ViStatus is. But while I use the viWrite *IDN?\n in session test tool, it sometimes get Return Count 0 with Return value BFFF003E or Return Count 6 with Return value 0. Hope it help.

(3)No.

(4)Sure! I can saw the USB Device in MAX.

Do you know which USBTMC instrument will support NI Visa?
0 Kudos
Message 3 of 9
(6,142 Views)
The hex return code "BFFF003E" is exactly what I said as ViStatus. The value returned from viWrite is VI_ERROR_IO. I believe that there may be a low-level IO error in the VISA layer. This may happen if the instrument IO protocol and the hosting USB driver are mismatched.

Once again check if:
(a) The instrument is really comliant with USBTMC (by checking Agilent's product specifcations, catalogue etc...)
(b) The USB driver hosting the instrument is NIUSBTMC.SYS (not NIVIUSBK.SYS).
(c) The VISA Resource String has the syntax like -
USB0::::::::INSTR.

NI-VISA supports both USBTMC and non-USBTMC instruments with different device drivers. If you mistakenly assigned the wrong type of USB driver, the instrumen
t IO does not work.

I believe *ANY* USBTMC instruments can be hosted by NI-VSIA 3.0. Normally VISA Driver Development Wizard is not needed for USBTMC instruments, since the NI USBTMC driver is automatically assigned to USB devices that have interface class code 0xFE and subclass 0x03. If you have another PC, it may be good to check if the instrument works with Agilent VISA (IO Libraries M01.00 or later).

Makoto
0 Kudos
Message 4 of 9
(6,142 Views)
Thanks for your precise answer! My problem have been solved by manual changing the USB driver to NIUSBTMC.SYS

But, why it been set to NIVIUSBK.SYS?

Another question: Does NI provide the Example reference source code to implement USBTMC instrument device?

rgs/Yuanyu
0 Kudos
Message 5 of 9
(6,142 Views)
I guess you did use VISA Driver Development Wizard to generate a custom INF file that enforced your instrument being hosted by the NIVIUSBK.SYS. But no custom INF file should be apllied to USBTMC instruments. Instead, use the NIUSBTMC.INF for any USBTMC instruments from any vendors.

As for programming, the only major difference with GPIB is that you need pass a VISA resource string having different syntax (as you can see in MAX) when calling viOpen(), though you will still need viUsbXXXX functions when performing a vendor-specific class request.

Makoto
0 Kudos
Message 6 of 9
(6,142 Views)
As I think, you may make a misunderstand for my question. My question is figure to the firmware example code in the USBTMC device, not the pc side.

Does NI provide this kind of example code?

rgs/Yuanyu
0 Kudos
Message 7 of 9
(6,142 Views)
NI-Device Plus seems like support USBTMC and VXI-11 for instrument firmware implementation. Sorry but I do not know if NI provides example codes for them since I am not NI person. Better to post as a new topic regarding it.

Makoto
0 Kudos
Message 8 of 9
(6,142 Views)
Hi,

Makoto is right, NI-Device Plus is a driver that implements both the VXI-11 and the USBTMC protocol on the device side.

The binary version of the driver is supported in most windows platforms.

There is also an NI-Device Plus DDK which allows you to implement the driver in non-supported OS. The DDK has two OS example layers: VxWorks and Linux, which show the implementation of a single-mode OS and a dual mode OS.

The DDK is written in C++.

If you need more details, it is probably better to make another posting or you can reach us at www.ni.com/ask.

Hope this helps.

DiegoF
National Instruments.
0 Kudos
Message 9 of 9
(6,142 Views)