Specify delay value for data logging
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.
You can define both pretriggers and postriggers. Pretriggers are specified with a negative TriggerDelay value while postriggers are specified with a positive TriggerDelay value. You can delay a trigger in units of time or samples with the TriggerDelayUnits property. Pretriggers are not defined for hardware triggers or when TriggerType is Immediate.
Pretrigger samples are included as part of the total samples acquired per trigger as specified by the SamplesPerTrigger property. If sample-time pairs are returned to the workspace with the getdata function, then the pretrigger samples are identified with negative time values.
AI, common to all channels
Read-only when running
Create the analog input object ai and add one channel to it.
ai = analoginput('winsound'); ch = addchannel(ai,1);
Configure ai to acquire 44,100 samples per trigger with 11,025 samples (0.25 seconds) acquired as pretrigger data.
ai.SampleRate = 44100 ai.TriggerType = 'Manual' ai.SamplesPerTrigger = 44100 ai.TriggerDelay = -0.25