This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Custom data


Manipulate custom data for a data acquisition session object using the UserData property. The property is never read-only. Its value can be any MATLAB® data type and format.


Create a session and define its UserData property fields.

s = daq.createSession('ni');
s.UserData.Data = [];
s.UserData.TimeStamps = [];
s.UserData.StartTime = [];

Set the start time, and append event information to the log fields stored in UserData.

s.UserData.StartTime = eventData.TriggerTime;
s.UserData.Data = [s.UserData.Data; eventData.Data];
s.UserData.TimeStamps = [s.UserData.TimeStamps; eventData.TimeStamps];

See Also