top of page
Writer's picturebilmamefounga

Ni Visa Runtime 5.4 Download: Compatible Devices and Supported Protocols



The issue I was having was when calling pyVisa's visa.Instrument("GPIB::1") it said the library was not found. However when calling visa.get_instruments_list() displayed my GPIB adapter as GPIB0. Using this as the device I was able to connect properly.




Ni Visa Runtime 5.4 Download




Some NI components require Microsoft Silverlight. If you do not have Silverlight installed on your computer, but you do have Internet access, you can download the installer from Microsoft at If you do not have Internet access, you can install Silverlight from this NI distribution media.


On this page you will find Datasheets, Application Notes, White Papers, Screencasts, and Software for all available products. To download any file, you can click on the blue link on the right side of each product. For zip files, they will automatically download to your downloads folder. For PDFs, clicking directly will open the PDF in a new browser window.


Analyzing the IR signal from a TV remote using an IR sensor and a Rigol DS1052E oscilloscope.Super-zoomable graphsOne of the nice features of the Rigol is "Long Memory" - instead of downloading the 600-point trace that appears on the screen, you can record and access a high-resolution trace of 1 million points. In this hack, I show how you can display this data with Python, giving you a picture that you can easily zoom into with the mouse.The following screenshot shows the data collected by hooking the oscilloscope up to an IR sensor. In the above picture, the sensor is the three-pin device below the screen. Since I've developed an IR library for Arduino, my examples focus on IR, but any sort of signal could be used.By enabling Long Memory, we can download not just the data on the screen, but 1 million data points, allowing us to zoom way, way in.The graph below shows what it sent when you press a button on the TV remote - the selected button transmits a code, followed by a periodic repeat signal as long as the button is held down.The IR signal from a TV remote. The first block is the code, followed by period repeat signals while the button is held down.But with Long Memory, we can interactively zoom way on the waveform and see the actual structure of the code - long header pulses followed by a sequence of wide and narrow pulses that indicate the particular button.That's not the end of the zooming - we can zoom way in on an edge of a pulse and see the actual rise time of the signal over a few microseconds. You can do some pretty nice zooming when you have a million datapoints to plot.To use this script, first enable Long Memory by going to Acquire: MemDepth. Next, set the trigger sweep to Single. Capture the desired waveform on the oscilloscope. Then run the Python script to upload the data to your computer, which will display a plot using matplotlib. To zoom, click the "+" icon at the bottom of the screen. This lets you pan back and forth through the data by holding down the left mouse button. You can zoom in and out by holding the right mouse button down and moving the mouse right or left. The magnifying glass icon lets you select a zoom rectangle with the mouse. You can zoom on your oscilloscope too, of course, but using a mouse and having labeled axes can be much more convenient.A few things to notice about the code. The first few lines get the list of instruments connected to VISA and open the USB instrument (i.e. your oscilloscope). The timeout and chunk size need to be increased from the defaults to download the large amount of data without timeouts.Next, ask_for_values gets various scale values from the oscilloscope so the axes can be labeled properly. By setting the mode to RAW we download the full dataset, not just what is visible on the screen. We get the raw data from channel 1 with :WAV:DATA? CHAN1. The first 10 bytes are a header and should be discarded. Next, the raw bytes are converted to numeric values with Mahto's formulas. Finally, matplotlib plots the data.There are a couple "gotchas" with Long Memory. First, it only works reliably if you capture a single trace by setting the trigger sweep to "single". Second, downloading all this data over USB takes 10 seconds or so, which can be inconveniently slow.Analyze an IR signalOnce we can download a signal from the oscilloscope, we can do more than just plot it - we can process and analyze it. In this hack, I decode the IR signal and print the corresponding hex value. Since it takes 10 seconds to download the signal, this isn't a practical way of using an IR remote for control. The point is to illustrate how you can perform logic analysis on the oscilloscope trace by using Python.This code shows how the Python script can wait for the oscilloscope to be triggered and enter the STOP state. It also shows how you can use Python to initialize the oscilloscope to a desired configuration. The oscilloscope gets confused if you send too many commands at once, so I put a short delay between the commands.Generate a spectrogramAnother experiment I did was using Python libraries to generate a spectrogram of a signal recorded by the oscilloscope. I simply hooked a microphone to the oscilloscope, spoke a few words, and used the script below to analyze the signal. The spectrogram shows low frequencies at the bottom, high frequencies at the top, and time progresses left to right. This is basically a FFT swept through time.A spectrogram generated by matplotlib using data from a Rigol DS1052E oscilloscope.To use this script, set up the oscilloscope for Long Memory as before, record the signal, and then run the script.Dump data to a .wav fileYou might want to analyze the oscilloscope trace with other tools, such as Audacity. By dumping the oscilloscope data into a WAV file, it can easily be read into other software. Or you can play the data and hear how it sounds.To use this script, enable Long Memory as described above, capture the signal, and run the script. A file channel1.wav will be created.How to install the necessary librariesBefore connecting your oscilloscope to your Windows computer, there are several software packages you'll need.I assume you have Python already installed - I'm using 2.7.3.Install NI-VISA Run-Time Engine 5.2. This is National Instruments Virtual Instrument Software Architecture, providing an interface to hardware test equipment.Install PyVISA, the Python interface to VISA.If you want to run the graphical programs, install Numpy and matplotlib.You can also use Rigol's UltraScope for DS1000E software, but the included NI_VISA 4.3 software doesn't work with pyVisa - I ended up with VI_WARN_CONFIG_NLOADED errors. If you've already installed Ultrascope, you'll probably need to uninstall and reinstall NI_VISA.If you're using Linux instead of Windows, see Mehta's article.How to control and program the oscilloscopeOnce the software is installed (below), connect the oscilloscope to the computer's USB port. Use the USB port on the back of the oscilloscope, not the flash drive port on the front panel.Hopefully the code examples above are clear.First, the Python program must get the list of connected instruments from pyVisa and open the USB instrument, which will have a name like USB0::0x1AB1::0x0588::DS1ED141904883. Once the oscilloscope connection is open, you can use scope.write() to send a command to the oscilloscope, scope.ask() to send a command and read a result string, and scope.ask_for_values() to send a command and read a float back from the oscilloscope.When the oscilloscope is under computer control, the screen shows Rmt and the front panel is non-responsive. The "Force" button will restore local control. Software can release the oscilloscope by sending the corresponding ":KEY:FORCE" command.Error handling in pyVisa is minimal. If you send a bad command, it will hang and eventually timeout with VisaIOError: VI_ERROR_TMO: Timeout expired before operation completed. The API to the oscilloscope is specified in the DS1000D/E Programming Guide. If you do any Rigol hacking, you'll definitely want to read this. Make sure you use the right programming guide for your oscilloscope model - other models have slightly different commands that seem plausible, but they will timeout if you try them.ConclusionsConnecting an oscilloscope to a computer opens up many opportunities for processing the measurement data, and Python is a convenient language to do this. The Long Memory mode is especially useful, since it provides extremely detailed data samples.Email ThisBlogThis!Share to TwitterShare to FacebookShare to PinterestLabels:electronics,ir,oscilloscope20 comments:Anonymoussaid...I really enjoyed this post. You always expose new and awesome information. Thank you for sharing your work so much!


I just got this to work on Mac Os X Mavericks.Mike, Follow the instructions on -deaver.org/Mac-PyVISA.htmlI grabbed the NI-VISA-Runtime-5.4.0 from Labviews web page.Download and install the PyVisa according to the instructions.Modify Kens script with adding from pyvisa.vpp43 import visa_libraryvisa_library.load_library("/Library/Frameworks/Visa.framework/VISA")beforeimport visaThat is all.


Hellofrom my PC running windows 7 I want to control my function generator DG1022 RIGOL with its USB HOST interface as I am not a developer this are 2 questions:1) After installing python, visa, pyvisa is it necessary to install other usb interfaces as openusb, libusb, USBTMC? .. )2) Has anyone ever done this driving of a 1000 Series RIGOL?Thank you for your informationDaniel de Paris in France[email protected]


I downloaded the NI-VISA and installed it in my 64-bit Windows-7 PC.The library is located at C:\Program Files (x86)\IVI Foundation\VISA\WinNT\lib\msc\visa32.lib. Note that there is also a 64-bit version of the library: C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Lib_x64\msc\visa64.lib. But I cannot compile a Qt project against it. There is also a 32-bit library compiled with Borland C++ compiler: C:\Program Files (x86)\IVI Foundation\VISA\WinNT\lib\bc\visa32.lib.Since Qt is compiled with Microsoft Visual C++, I use visa32.lib in the msc directory instead of the one in the bc directory. 2ff7e9595c


0 views0 comments

Recent Posts

See All

Comments


bottom of page