| Data Acquisition Toolbox | ![]() |
Specify the delay value for data logging
Description
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.
Characteristics
| Usage |
AI, Common |
| Access |
Read/write |
| Data type |
Double |
| Read-only when running |
Yes |
Values
Example
Create the analog input object ai and add one channel to it.
Configure ai to acquire 44,100 samples per trigger with 11,025 samples (0.25 seconds) acquired as pretrigger data.
set(ai,'SampleRate',44100) set(ai,'TriggerType','Manual') set(ai,'SamplesPerTrigger',44100) set(ai,'TriggerDelay',-0.25)
Properties
SamplesPerTrigger, TriggerDelayUnits
| TriggerConditionValue | TriggerDelayUnits | ![]() |