Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

PyVISA, USB-6225 in WindowsXP SP3, ActivePython 2.7.2.5

I just bought a brand new USB-6225 with the SCB-68A 68-Pin Connector Block box. I have a question about how to use this device in Python with PyVISA. The problem is that the USB0 device does not enumerate and VISA Interactive Control cannot read responses from it.

 

I can view the USB-6225 in MAX - it shows up both as 'NI USB-6225 (Mass Termination) "Dev1" ' and as 'USB-6225 (Mass Termination)'.

 

In XP's Device Manager, it shows up under "Data Acqusition Devices" as "USB-6225 (Mass Termination)".

 

I can fire up the Test Panel for the USB-6225 and view the signal I am injecting into Dev1/ai1. It's a simple 1 Hz 10Vpp sine wave. RSE, On Demand. Runs great! The software displays the sinewave.

 

In order to use the USB-6225 with Python, I installed NI-VISA 5.4 and the NI-VISA Runtime 5.4. PyVISA 1.4 was also installed.

 

Then I used the NI-VISA Driver Wizard to create an XP .inf file. I used a prefix string of "usb6225". The Driver Wizard installed this XP driver. In MAX, the "NI USB-6225" and 'USB-6225 (Mass Termination)' entries were replaced by a new entry, "MSeries USB 6225 (Mass Termination) USB0::0x3923::0x7330::018C1F47::RAW'. I understand that the numbers represent the vendorID, Model, and Serial Number. A new item in XP's Device Manger shows up as, "MSeries USB 6225 (Mass Termination)" under "NI-VISA USB Devices".

 

In MAX, I left-click on the new item and the middle pane shows the properties of this device. Its status is "Present". So far so good, I think.

 

However, this USB device will not enumerate when used with PyVISA in a Python script. The computer's two COM and one printer port show up, but not the USB device.

 

I can fire up NI's VISA Interactive Control program. The USB0 device shows up under "USB RAW Resources" as "USB0::0x3923::0x7330::018C1F47::RAW". However, my Python script doesn't see it.

 

The output of the script to show the enumerations of the devices is as follows:

 

['ASRL1', 'ASRL2', 'ASRL10']
['COM1', 'COM2', 'LPT1']

 

So, as you can see, the PC's standard ports show up, but USB0 does not.

 

Here is the Python script ("enumerate.py") :

 

------

 

from visa import *

my_instrument = get_instruments_list(0)
print my_instrument
my_instrument = get_instruments_list(1)
print my_instrument

 

------

 

Is there something I'm missing?

 

In VISA Interactive Control, when I double-click the USB0 device a new window pops up. This new window allows me to 'talk' to the device and test it out, etc.

 

Under Input/Output, Basic I/O tab, I select the command, "*IDN?\n" and hit the "Write" button. The "Return Data" Window shows "Write Operation (*IDN?\n") No Error". The big window in this applet shows: "Return Count: 6 bytes".

 

Then I hit the "Read" button, the "Return Data" window shows "Read Operation Error VISA:  (Hex 0xBFFF003E) Could not perform operation because of I/O error."

 

Then I hit the "Clear" button and it returns "Device Clear Operation No Error".

 

Then I hit the "Query" button and I get the same error as before.

 

I tried both 1024 bytes and 6 bytes in the "Bytes to Read" selection.

 

So, I'm wondering if this device isn't set up properly, PyVISA doesn't support this unit,  or this brand-new unit is maybe broken.

 

Is there a step I'm not doing? Is there a problem with the device or the programming environment?

 

 

Thanks in Advance.

0 Kudos
Message 1 of 6
(4,980 Views)
None of this makes any sense. Why throw a working driver for one of your own? NI does not make available the USB RAW interface and expecting anything back from *IDN? is just naive.
0 Kudos
Message 2 of 6
(4,972 Views)

@Dennis_Knutson wrote:
None of this makes any sense. Why throw a working driver for one of your own? NI does not make available the USB RAW interface and expecting anything back from *IDN? is just naive.

Dennis,

 

Thanks for the reply...

 

> Why throw a working driver for one of your own?

 

What do you mean by this? The "working driver" will work with PyVISA out of the box? If not, then how would one use PyVISA/Python to talk to the USB-6225? I tried using the 'stock' driver and the USB-6225 (USB0) device would not enumerate from Python/PyVISA.

 

> NI does not make available the USB RAW interface and expecting anything back from *IDN? is just naive.

 

Yes it is VERY naive....I'm new to this.

 

I think I have two choices here, I can work with the USBRAW interface, but I suspect something is broken since the USB0 device doesn't even appear using PyVISA. So, I was hoping that an INSTR or RAW type of resource would appear, but NOTHING shows up.

 

So, bottom line is I'm asking: How can one use Python/PyVISA to talk to the USB-6225 with the SCB-68A? When using PyVISA, etc, the only devices that enumerate are the two serial ports and the printer port.

 

Thanks

0 Kudos
Message 4 of 6
(4,962 Views)

@KateB wrote:

http://digital.ni.com/public.nsf/allkb/ED1C0156519E3E348625748A00198020


KateB,

 

Thanks for the link.Using DAQmx with Python is my "Plan B" if I find that PyVISA with the NI USB-6225 is broken.

0 Kudos
Message 5 of 6
(4,960 Views)
The working driver is DAQmx.

*IDN? is a command from IEEE-488.2. It is ridiculous to think it is supported by a DAQ device. You are just making things up and you'll never get it to work.
0 Kudos
Message 6 of 6
(4,951 Views)