Linux Command Line Analog Input Finite Samples
Overview
The use of a custom command line function with arguments to do analog input for finite samples in Linux.
**The accompanying code represents a very specific use case for NI products. For more general examples, please refer to ni.com/examples, the LabVIEW Example Finder, or the NI driver help files that come with every NI driver.
Downloads
Filename: analog_in.rar
Requirements: View
This example demonstrates how to use a custom command and arguments to do analog input using DAQmx from the linux command line. After the samples are acquired, they are displayed on the screen along with the number of samples and channels. The example also includes a manual page for the command line analog input function. Follow the directions in the README.txt in the RAR file for the file directory locations. Below are the contents of the man page for the function ain.
AIN(8) AIN(8)
NAME
ain - finite analog input
SYNOPSIS
ain [ device number ] [ channel ] [ range ] [ num samples ]
DESCRIPTION
ain will acquire a certain number of samples num samples from a data
acquisition device device number on a specified analog input channel
channel
These are the parameters:
device number
The device number as specified by DAQmx. To get the list of
devices with number run nilsdev which will give Dev# where # is
the device number
channel
The analog input channel to read the samples from. You can also
pass all to read from all analog input channels.
range The voltage range for the analog input channel(s) as in +- (Ex:
10).
num samples
The number of samples to acquire on the analog input channel
EXAMPLE
ain 0 0 10 5
Acquires 5 samples from DAQ device Dev0 on analog input channel
ai0 with voltage range of +- 10V
ain 1 all 5 10
Acquires 10 samples from DAQ device Dev1 on all analog input chan-
nels with a voltage range of +- 5V
NOTE
The range must be valid for the specified DAQ device
SEE ALSO
aout(8), din(8), dout(8)
AIN(8)
Requirements
Filename: analog_in.rar
Software Requirements
Language(s): C
Hardware Requirements
Hardware Group: Multifunction DAQ (MIO)
Driver: NI-DAQmx 8.0
Reader Comments | Submit a comment »
Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program 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 program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM 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/).
