Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: May 14, 2008


Feedback


Yes No

Related Links - Developer Zone

Related Links - Products and Services

Instrument Control in Linux® Tutorial

1 ratings | 5.00 out of 5
Read in | Print

What You Need to Control Your Instrument in Linux

To control your instrument on a Linux machine you need to install NI-VISA. You can get the latest version of NI-VISA from the Drivers and Updates webpage.

Before you install NI-VISA on a Linux machine, make sure that your distribution of Linux is compatible. You can find this information under the Description section of the driver that you want to install or in the readme.txt file. The readme.txt file also contains downloading instructions.

There are two VISA utilities for testing and configuring your instrument in Linux – Interactive Control of VISA (VISAIC) and visaconf. Following, is more information on these two utilities.

Interactive Control of VISA


NI-VISA comes with a utility called VISA Interactive Control (VISAIC) on all VISA-compatible OSs, with the exception of Mac OS and VxWorks. This utility gives you access to all VISA functionality interactively, in an easy-to-use graphical environment. It is a convenient starting point for program development and learning about VISA. This utility is a test panel and cannot be used to change settings on your instrument.

Note: To launch VISAIC on Linux, it is called NIvisaic.

When VISAIC runs, it automatically finds all of the available resources in the system and lists the instrument descriptors for each of these resources under the appropriate resource type. This information is displayed on the VISA I/O tab.

The following figure shows the VISAIC opening window.

Figure 1. VISAIC Opening Window

The Soft Front Panels tab of the main VISAIC panel gives you the option to launch the soft front panels of any VXIplug&play instrument drivers that have been installed on the system.

The NI I/O tab gives you the option to launch the NI-VXI interactive utility or the NI-488.2 interactive utility, which gives you convenient links into the interactive utilities for the drivers VISA calls in case you would like to try debugging at this level.

Double-clicking on any of the instrument descriptors shown in the VISAIC window opens a session to that instrument. Opening a session to the instrument produces a window with a series of tabs for interactively running VISA commands. The exact appearance of these tabs depends on which compatibility mode VISAIC is in. To access the compatibility mode and other VISAIC preferences, select Edit»Preferences... to bring up the following window.



Figure 2. VISAIC Preferences Window

visaconf


visaconf is the VISA configuration utility for Linux and Mac OS X. Use this utility to add and configure instruments in your system. The following image is the window that opens when you run visaconf:

Figure 3. VISA Configuration Window

If your instrument is not displayed under the Resource Editor tab, you can use the Add Static button to add it to your system.

Using Instrument Drivers in Linux


Interchangeable Virtual Instrument (IVI) drivers run on only Windows OSs. If you want to use an instrument driver in Linux, it must be a Plug and Play driver. To download an instrument driver, you must make sure it is packaged as a VI or llb file. You cannot open or install the driver on Linux if it is a .exe file.

To access the instrument driver VIs in LabVIEW, save the llb and menu files in the LabVIEW\instr.lib folder. You will now have access to the VIs from the Functions>>Instrument I/O>>Instrument Drivers palette. You can use these VIs to communicate with your instrument.

Using LabVIEW and VISA to Control Your Instrument


If an instrument driver does not exist for your instrument, you can use VISA functions in LabVIEW to control your instrument. Make sure to have your user manual available, because you will need to be familiar with the commands that your instrument responds to. Refer to the VISA API section in the following document: Instrument Control in LabVIEW Tutorial, for more help on using VISA in LabVIEW.

You can access the VISA VIs from the Function>>Instrument I/O>>VISA palette.

Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries

Related Links


Supported NI-VISA Operating Systems and Features
Drivers and Updates
Instrument Driver Network
Linux
How to Use an Instrument Driver in LabVIEW Tutorial
How to Use an Instrument Driver in LabWindows/CVI Tutorial
Instrument Control in Mac OS X Tutorial
Instrument Control in LabVIEW Tutorial
Instrument Control in LabWindows/CVI Tutorial

1 ratings | 5.00 out of 5
Read in | Print

Reader Comments | Submit a comment »

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).