WaitForValidTimestamp(TimestampEvent)
- Updated2026-02-03
- 1 minute(s) read
Waits indefinitely until the specified timestampEvent has a value.
Syntax
Namespace: NationalInstruments.DAQmx
public PrecisionDateTime WaitForValidTimestamp(TimestampEvent timestampEvent)
Remarks
To avoid an exception, use this method to ensure a timestamp has a valid value before querying it.
To use this method, you must first enable timestamps for the timestamp event type specified by timestampEvent . The following code demonstrates how to do this for StartTrigger.
// Using an instance of Task called 'myTask'.
myTask.Triggers.StartTrigger.TimestampEnable = true;
myTask.Start();
myTimestamp = myTask.WaitForValidTimestamp(TimestampEvent.StartTrigger);
' Using an instance of Task called 'myTask'.
myTask.Triggers.StartTrigger.TimestampEnable = True
myTask.Start()
myTimestamp = myTask.WaitForValidTimestamp(TimestampEvent.StartTrigger)
Parameters
| Name | Type | Description |
|---|---|---|
| timestampEvent | TimestampEvent | Specifies the timestamp event type to wait on. For more information see TimestampEvent. |
Returns
The requested timestamp value.
Exceptions
| Type | Description |
|---|---|
| NationalInstruments.DAQmx.DaqException | The NI-DAQmx driver returned an error. |