Store data to associate with device object
Note: You cannot use the legacy interface on 64-bit MATLAB®. See Working with the Session-Based Interface to acquire and generate data on a 64-bit MATLAB.
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.
AI, AO, DIO, common to all channels and lines
Read-only when running
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; ai.UserData = coeff