Author Topic: Rigol C# .NET NI-VISA Example  (Read 29798 times)

0 Members and 1 Guest are viewing this topic.

Offline RoglaTopic starter

  • Newbie
  • Posts: 1
Rigol C# .NET NI-VISA Example
« on: October 16, 2012, 12:35:10 am »
Hi all,

I would like to share some of my experiences about writing an simple application to be able to fetch data from my Rigol boxes. Primary a logger for a DM3064. I used C#.NET 2010 on Windows 7 64-bit, application compiled as x86.

- First mistake I made, I installed NI-VISA Runtime instead of NI-VISA Full Driver.
All needed development assemblies are in the NI-VISA Full Driver package.
Download NI-VISA 5.2 Full Driver from here:
http://joule.ni.com/nidu/cds/view/p/id/3337/

- On creation of the C# Windows application, select .NET Framework 4.
(The .NET Framework 4 Client Profile didn't work with NI-VISA 5.2).

- Adding reference to NationalInstruments.VisaNS automatically also adds reference to NationalInstruments.Common, no need to search for NationalInstruments.Common...

- There was a version problem on the NationalInstruments.Common assembly version referenced by the NationalInstruments.VisaNS assembly. I had to remap the old missing NationalInstruments.Common version to a newer version. See App.config in attached source code example.

- After connecting the USB device, from National Instruments Program menu, start the VISA\VISA Interactive Control program and copy the VISA resource ID for the USB device. Add that to the ComboList in the example code.

- The attached example is based on a PDF from Rigol USA that can be found here:
http://www.rigolna.com/products/digital-multimeters/dm3000/dm3068/
Tab Software, file "C#.NET basic instrument communication example"

- Documentation about SCPI commands to send to the device is on the Rigol product page.
To check the device ID information, write command *IDN? and then read the answer back.


This is i very simple and basic example, but it took me some time to figure this out, so I hope someone else will find it useful.

/Roger


« Last Edit: October 16, 2012, 12:56:47 am by Rogla »
 
The following users thanked this post: CCB, s8548a

Offline leafi

  • Regular Contributor
  • *
  • Posts: 71
Re: Rigol C# .NET NI-VISA Example
« Reply #1 on: January 26, 2017, 03:56:35 pm »
Thank you for posting this. I am having to go back and update a program that I made a year ago and have reformatted my pc since then and was having problems finding and re-downloading the right files.
 

Offline Elmue

  • Newbie
  • Posts: 5
  • Country: de
There is a much better alternative than NI-VISA
« Reply #2 on: March 05, 2025, 11:52:51 am »
Hello

What you are showing here requires to install the HUGE VISA runtime.
Alone the installer has the size of 1 Gigabyte.
After installing NI-VISA you will have 12 (twelve!) services permanently running in the background.
So you recommend to install 1 Gigabyte just to do a simple communication with a Rigol multimeter?
This is like throwing an atomic bomb to kill a bug.

For me it was never an option to install this VISA monster.
Therefore I wrote my own software Oszi Waveform Analyzer in C# which communicates over USB or over ethernet using the VXI-11 protocol or plain TCP.
I publish my software open source so you can use the code for any SCPI capable device in the world.

The only thing you have to install is the tiny USB driver of 24 kilobyte.
Yes! You have read correctly: 24 Kilobytes instead of 1 Gigabyte!
My code communicates directly with my oscilloscope needing nothing more than .NET functionality.

Here you see the window that communicates with my Rigol oscilloscope:



Download and detailed description here:

https://netcult.ch/elmue/oszi-Waveform-Analyzer
« Last Edit: March 05, 2025, 12:41:07 pm by Elmue »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf