Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Write a program in C on Linux to communicate via TCP/IP

Solved!
Go to solution

Hello. I am interested in pushing commands to and retrieving spectral data from our spectrum analyzer. I would also like to write my own software to do this, in a Red Hat Linux environment.

 

I attempted to write a program in C and found that I needed the `visa.h' header file. Well, my search began. I found PyVisa and OpenVisa. PyVisa requires VISA to be already installed and OpenVisa seemed to sketchy for me to rely on.

 

Now, here is my question: I found the NI-VISA Universal I/O Interface Software, this costs money both for the development software and the deployment software.

 

I do not expect any one person to answer these questions. Any help is appreciated.

 

  1. Is there any other option than buying the interface software from NI?

     

  2. What do you get with each (e.g. development and deployment)?

     

  3. Is the license per node or is it enterprise?

     

  4. Is there an evaluation copy of the development software available to test it out to see if we even want to pursue this capability for us?

     

  5. Would I be restricted to one programming language in the development software?

     

  6. If not, what languages does the development software support, specifically Java or C++.

     

  7. If I were to write a program in C as I mentioned above, is `visa.h' the only header file that I need?

     

Many thanks for your time.

 

-N

 

 

 

 

0 Kudos
Message 1 of 3
(6,048 Views)
Solution
Accepted by topic author lotso

Hi,

 

Here is some useful information about using NI-VISA.  The first link should answer the licensing questions that you had, and the second link provides information about getting started and programming with NI-VISA:

 

VISA Licensing Info:

https://www.ni.com/en-us/shop/product/ni-visa.html

 

Getting Started and Programming with NI-VISA:

https://www.ni.com/docs/en-US/bundle/ni-visa/page/getting-started-with-instrument-control.html 

 

As you'll find in the links above, when programming in a Linux environment, the language is restricted to ANSI C.  As far as evaluation software goes, we do not have any available for Linux based platforms.  But, you can download free NI-VISA drivers for Linux here (which includes visa.h):

 

https://www.ni.com/en/support/downloads/drivers/download.ni-visa.html

 

The above download will also include some C examples of how to do TCP/IP communication.  I hope this helped answer you questions!

Shelby S
National Instruments
Applications Engineer
Message 2 of 3
(6,017 Views)

While your post perfectly answers my question, I just wanted to share this resource which worked for me out of the box today....

 

http://optics.eee.nottingham.ac.uk/vxi11/

 

Message 3 of 3
(6,004 Views)