NI-DAQmx .NET Framework 4.0 API Reference

Task.WaitForValidTimestamp Method (TimestampEvent)

  • Updated2023-02-21
  • 1 minute(s) read
Task.WaitForValidTimestamp Method (TimestampEvent)
Waits indefinitely until the specified timestampEvent has a value.

Namespace:  NationalInstruments.DAQmx
Assembly:  NationalInstruments.DAQmx (in NationalInstruments.DAQmx.dll) Version: 20.7.40.49302

Syntax

public PrecisionDateTime WaitForValidTimestamp(
	TimestampEvent timestampEvent
)
Public Function WaitForValidTimestamp ( 
	timestampEvent As TimestampEvent
) As PrecisionDateTime

Parameters

timestampEvent
Type: NationalInstruments.DAQmxTimestampEvent
Specifies the timestamp event type to wait on. For more information see TimestampEvent.

Return Value

Type: PrecisionDateTime
The requested timestamp value.

Exceptions

ExceptionCondition
DaqException The NI-DAQmx driver returned an error.

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.

Examples

// Using an instance of Task called 'myTask'.
myTask.Triggers.StartTrigger.TimestampEnable = true;
myTask.Start();
myTimestamp = myTask.WaitForValidTimestamp(TimestampEvent.StartTrigger);

Examples

' Using an instance of Task called 'myTask'.
myTask.Triggers.StartTrigger.TimestampEnable = True
myTask.Start()
myTimestamp = myTask.WaitForValidTimestamp(TimestampEvent.StartTrigger)

See Also

Log in to get a better experience