From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to communicate with equipment using GPIB-USB-HS

Hello community!

 

I am currently using a gpib-usb-hs to communicate with my Agilent 6611C via python but when I run the code I get the following error:

 

"pyvisa.errors.VisaIOError: VI_ERROR_INV_SETUP (-1073807302): Unable to start operation because setup is invalid (usually due to attributes being set to an inconsistent state)."

 

Code used: 

 
import visa
 
rm = visa.ResourceManager()
 
dev = rm.open_resource('GPIB0::0::INSTR')
print(dev.query("*IDN?"))
 
Has anyone come across a similar issue and have been able to solve it?
 
Thank you in advance for the attention!
0 Kudos
Message 1 of 3
(2,784 Views)

Can you communicate with the device via NI-MAX?

Is the GPIB address really 0?   ( 0 is allowed just uncommon.) 

Does this instrument need a secondary address?   GPIB0::0::2::INSTR?  Some PSU are chainable and have secondary address you need to use to address them.

Should you have a termination character with that "*IDN?"  like "*IDN?\r".

I haven'r used PyVISA in a long time, and you are likely to get better answers on its use elsewhere.

0 Kudos
Message 2 of 3
(2,764 Views)

Typically your GPIB0::0 is the controller and it will not respond to a command to itself.  Do you know the address of your controller?  Can you Poll for instruments on the GPIB0 bus?  It may give you the answers or at least a direction to follow.

 

Additionally, older pieces of equipment or firmware will not respond to the "*IDN?\n", but will to the previous "ID?\n".

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 3 of 3
(2,730 Views)