Data Acquisition Toolbox | ![]() ![]() |
Indicate the offset to use when converting data from native format to doubles
Description
NativeOffset
, along with NativeScaling
, is used to convert data from your hardware's native format to doubles using the formula
For analog input objects, you return data from the engine in native format using the getdata
function. Additionally, if you log native data to a .daq
file, then you can read back that data using the daqread
function. For analog output objects, you queue native data in the engine using the putdata
function. You may want to return or queue data in native format to conserve memory and to increase speed.
The NativeOffset
value for a given channel may change if you change the UnitsRange
, SensorRange
, or InputRange
property values for that channel.
You can return the native data type of your hardware device with the daqhwinfo
function.
Characteristics
Usage |
AI, AO, Channel |
Access |
Read-only |
Data type |
Double |
Read-only when running |
N/A |
Values
The default value is device-specific.
Example
Create the analog input object ai
for a National Instruments board, and add eight channels to it.
ai = analoginput('nidaq',1); addchannel(ai,0:7);
Start ai
, collect one second of data for each channel, and extract the data from the engine using the native format of the device.
start(ai) nativedata = getdata(ai,1000,'native');
You can return the native data type of the board with the daqhwinfo
function.
out = daqhwinfo(ai); out.NativeDataType ans = int16
Convert the data to doubles using the NativeScaling
and NativeOffset
properties.
scaling = get(ai.Channel(1),'NativeScaling'); offset = get(ai.Channel(1),'NativeOffset'); data = double(nativedata)*scaling + offset;
Functions
daqhwinfo
, daqread
, getdata
, putdata
Properties
InputRange
, NativeScaling
, SensorRange
, UnitsRange
![]() | Name | NativeScaling | ![]() |