Data Acquisition Toolbox | ![]() ![]() |
Example: Performing a Linear Conversion
This example illustrates how to configure the engineering units properties for an analog input object connected to a National Instruments PCI-6024E board.
An accelerometer is connected to a device which is undergoing a vibration test. Your job is to measure the acceleration and the frequency components of the device while it is vibrating. The accelerometer has a range of ±50 g's, a voltage sensitivity of 99.7 mV/g, and a resolution of 0.00016 g.
The accelerometer signal is input to a Tektronix TDS 210 digital oscilloscope, and to channel 0 of the data acquisition board. By observing the signal on the scope, the maximum expected range of data from the sensor is ±200 mV, which corresponds to approximately ±2 g's. Given this constraint, you should configure the board's input range to ±500 mV, which is the closest input range that encompasses the expected data range.
You can run this example by typing daqdoc5_8
at the MATLAB command line.
AI
for a National Instruments board. The installed adaptors and hardware IDs are found with daqhwinfo
.
AI
.
SensorRange
is set to the maximum accelerometer range in volts, and UnitsRange
is set to the corresponding range in g's. InputRange
is set to the value that most closely encompasses the expected data range of ±200 mV.
Calculate and display the frequency information.
Fs = ActualRate; blocksize = duration*ActualRate; [f,mag]= daqdocfft(data,Fs,blocksize); subplot(2,1,2),plot(f,mag)
Make sure AI
has stopped running before cleaning up the workspace.
AI
, you should remove it from memory and from the MATLAB workspace.
![]() | Linearly Scaling the Data: Engineering Units | Analog Output | ![]() |