Quantcast

Documentation Center

  • Trial Software
  • Product Updates

UserData

Store data to associate with device object

Description

    Note:   You cannot use the legacy interface on 64–bit MATLAB®. See Session-Based Interface to acquire and generate data.

UserData stores data that you want to associate with the device object.

Note that if you return analog input object information to the MATLAB workspace using the daqread function, the UserData value is not restored.

Characteristics

Usage

AI, AO, DIO, common to all channels and lines

Access

Read/write

Data type

Any type

Read-only when running

No

Values

The default value is an empty vector.

Examples

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

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

Suppose you want to access filter coefficients during the acquisition. You can create a structure to store these coefficients, which can then be stored in UserData.

coeff.a = 1.0;
coeff.b = -1.25;
set(ai,'UserData',coeff)
Was this topic helpful?