getsample

Immediately acquire one analog input sample

Syntax

sample = getsample(obj)

Arguments

obj

An analog input object.

sample

A row vector containing one sample for each channel contained by obj.

Description

sample = getsample(obj) immediately returns a row vector containing one sample for each channel contained by obj.

Examples

Create the analog input object ai and add eight channels to it.

ai = analoginput('nidaq','Dev1');
ch = addchannel(ai,0:7);

The following command returns one sample for each channel.

sample = getsample(ai);

More About

expand all

Tips

Using getsample is a good way to test your analog input configuration. Additionally:

  • getsample does not store samples in, or extract samples from, the data acquisition engine.

  • You can execute getsample at any time after channels have been added to obj.

  • getsample is not supported for sound cards and Dynamic Signal Acquisition and Generation (DSA) cards.

    Note:   Refer to the Hardware Limitations by Vendor section before you access National Instruments® devices with the NI-DAQmx adaptor simultaneously from multiple applications.

See Also

|

Was this topic helpful?