Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

PyVISA cannot communicate with Keithley2400 using Prologix GPIB-USB

Is anyone familiar with how exactly NI-VISA operates? What dll's it looks for and such? It appears to look in Windows/System32 and/or Windows/SysWOW64 for libraries. I only have a few NI downloads on my computer and I see a handful of nixxxx.dll drivers. Things like ni488ico.dll, nivisa64.dll, etc. No gpib librarys, but there is nivisa64.dll. I tried using this library as the manual gpib library (probably not applicable but figured I would try). That doesn't seem to work as I get an error saying function 'ibask' can't be found. I am assuming this is something strange in gpib_ctypes and C/C++/Python incongruences. I am new to all of this though so I really have no idea. Most issues I see with GPIB NI-VISA communication problems, the user can find gpib-32.dll in there System32 folder, I am not sure I found one where they didn't have the library at all.

0 Kudos
Message 21 of 27
(1,406 Views)

Hello

Please do not search for gpib dlls anymore. Your prologix adapter is a serial interface that internally translates to gpib.

The NI-visa only supports NI-gpib cards, not the prologix catd!!!!

greetings from the Netherlands
Message 22 of 27
(1,402 Views)

Ok that is great to know thank you! Pymeasure (which has functions specifically for prologix and other adapters) uses pyvisa which requires a VISA backend, and pyvisa recommends and is tested with NI-VISA. So perhaps my question is how NI-VISA is used as a backend especially since it was tested (and worked for me for a year) with the Prologix cable and now doesn't work due to which pyvisa claims is a lack of a gpib library? I realize this may be more of a pyvisa question, but unfortunately I have not heard back from the pyvisa github page. Any thoughts on how NI-VISA could be used as a backend? Or what may cause it to suddenly stop working? The issue started around when NI-VISA's newest update launched. Does anyone know what changed between the versions? Thanks to everyone who is replying, I truly appreciate it!

0 Kudos
Message 23 of 27
(1,395 Views)

It could be actually a pymeasure issue too. Pyvisa folks will likely not own a Prologix adapter since it is not really to useful under Visa only (well it can be used but requires special stuff on the application level similar to what pymeasure does). For many users that’s a little to complicated.

Rolf Kalbermatter
My Blog
Message 24 of 27
(1,393 Views)

Ok thanks! That is a good point, I will open a question on the pymeasure github, too! If I do find a solution (via forum or otherwise) I will be sure to post it here so people can refer back to it. In the meantime, do you know how NI-VISA changed in the latest update? Or generally how it works on its own or as a backend? 

0 Kudos
Message 25 of 27
(1,387 Views)

Attached is an example of each of the communications I have had in the past using Prologix and using NI's GPIB. (NI IO Trace format.)
The instrument is an HP 4294A, not a Keithley.
Also, the program is Excel VBA, not Python.
Prologix fails to transfer the binary (data is missing on the way), so I also attach an example of that case.

For Prologix, we need to deal with both commands for Prologix itself and commands for the instrument.
For this reason, I personally think that Prologix is a device for experts.
For beginners, the shortcut is to use the GPIB of NI or Keysight, which supports VISA natively.

0 Kudos
Message 26 of 27
(1,360 Views)

I am have never used nitrace or the type of communication/programming you mentioned here, but I more or less follow what you're saying and it does sound quite difficult. Thanks for everyone's input! It isn't a perfect solution as I still get warnings, but I finally have my python system working again. Pymeasure github issues forum suggested I try using pyvisa-py. I am sure I had tried this before however I think it failed before because I ran it in the python console in PyCharm and I may not have typed it in quite right; I also was not testing communciation directly, just checking for the GPIB issue which technically still appears. Anyhow, here is how the code got changed in the snippet (and it applies for my large code as well, anywhere you try to instantiate a pymeasure.adapter)

 

adapter = pymeasure.adapters.PrologixAdapter('ASRL3::INSTR', visa_library="@py")

 

I still get these warnings even though communication works again:

 

UserWarning: GPIB library not found. Please manually load it using _load_lib(filename). All GPIB functions will raise OSError until the library is manually loaded.
warnings.warn(message)
0 : USB0::0x0699::0x0408::C012230::INSTR : TEKTRONIX,MDO3024,C012230,CF:91.1CT FV:v1.10
1 : ASRL3::INSTR : Visa IO Error: check connections
VI_ERROR_RSRC_BUSY (-1073807246): The resource is valid, but VISA cannot currently access it.
2 : ASRL7::INSTR : Not known
3 : ASRL9::INSTR : Not known
4 : ASRL10::INSTR : Visa IO Error: check connections
VI_ERROR_SYSTEM_ERROR (-1073807360): Unknown system error (miscellaneous error).
5 : ASRL11::INSTR : Not known
('USB0::0x0699::0x0408::C012230::INSTR', 'ASRL3::INSTR', 'ASRL7::INSTR', 'ASRL9::INSTR', 'ASRL10::INSTR', 'ASRL11::INSTR')

Process finished with exit code 0

 

I am still unsure why the NI-VISA backend worked for many months and no longer does. I am still confused about the above issues and warnings, too. I will post back if I find any answers to these questions, and I welcome any input as to why this might have happened. Many thanks to everyone for helping me these past 2 weeks!

0 Kudos
Message 27 of 27
(1,352 Views)