Creating and Reading Timestamps
Use the NI-Sync timestamp VIs to record the board time when an event—like a clock edge, trigger, or future time event—occurs. You can use timestamps to measure clock drift and skew between devices, record changes in a signal, or mark the beginning and end of data acquisition.
 |
Note - Timestamping is available only on time-based timing and synchronization modules.
- You can only timestamp terminals with I/O, such as trigger signals, future time events, synchronization clock signals, and clocks generated with DDS or niSync Create Clock.
|
Complete the following steps to timestamp a user-generated clock using the NI-Sync timestamp VIs and niSync Create Clock:
- Place niSync Initialize.
- Place niSync Create Clock and configure it:
- Select the Ticks instance.
- Wire a control or constant to terminal and select the terminal you would like to create the clock on.
- Specify the number of high ticks and low ticks each clock cycle will have using high ticks and low ticks.
- (Optional) Specify a start and stop time for the clock using start time and stop time.
- Place niSync Enable Time Stamp Trigger and configure it:
- Connect terminal to the same terminal you generated the clock on.
- (Optional) Wire a control or constant to decimation count to adjust the number of timestamps that occur between recorded timestamps.
- (Optional) Wire a control or constant to active edge to create timestamps on a specific clock edge.
- Place niSync Read Trigger Time Stamp and configure it:
- Select the Read Single Timestamp instance to read the first timestamp written, or select the Read Multiple Timestamps instance to read a specified number of timestamps.
- Wire terminal to the same terminal you generated the clock on.
- Wire an indicator to time stamp out. This returns an array of timestamps if you selected the Read Multiple Timestamps instance, or a single timestamp if you selected the Read Single Timestamp instance.
- (Optional) Wire an indicator to detected edge to return the clock edge the timestamp was recorded on.
- (Optional) Wire a control or constant to timeout to specify how long, in seconds, the VI should try to read a timestamp before stopping.
- (Optional) If you selected the Read Multiple Timestamps instance, wire a control or constant to number of timestamps to specify how many timestamps the VI should read.
- Place niSync Disable Time Stamp Trigger and wire terminal to the same terminal you generated the clock on.
- Place niSync Clear Clock and wire terminal to the terminal you generated the clock on.
- Place niSync Close to end the NI-Sync session and free all resources for another program.
After you complete the preceding steps, you have an application that records a timestamp whenever there is a rising edge to the clock you generate with niSync Create Clock. You can substitute niSync Create Clock with any clock signal, future time event, or trigger signal that you can propagate on a PFI or PXI_Trig line to timestamp those signals.