Table Of Contents

Creating and Reading Timestamps

Version:
    Last Modified: September 15, 2017

    Timestamps a user-generated clock using the NI-Sync timestamp functions and the Create Clock function.

    Use NI-Sync timestamp functions 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.
    spd-note-note
    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 Create Clock.
    1. Place Initialize on the diagram.
    2. Place Create Clock on the diagram and configure it.
      1. Select the Ticks mode.
      2. Wire a control or constant to terminal and select the terminal you would like to create the clock on.
      3. Specify the number of high ticks and low ticks each clock cycle will have using high ticks and low ticks.
      4. (Optional) Specify a start and stop time for the clock using start time and stop time.
    3. Place Enable Time Stamp Trigger on the diagram and configure it.
      1. Connect terminal to the same terminal you generated the clock on.
      2. (Optional) Wire a control or constant to decimation count to adjust the number of timestamps that occur between recorded timestamps.
      3. (Optional) Wire a control or constant to active edge to create timestamps on a specific clock edge.
    4. Place Read Trigger Time Stamp on the block diagram and configure it.
      1. Select the Single Timestamp mode to read the first timestamp written, or select the Multiple Timestamps instance to read a specified number of timestamps.
      1. Wire terminal to the same terminal you generated the clock on.
      2. Wire an indicator to time stamp out. This returns an array of timestamps if you selected the Read Multiple Timestamps mode, or a single timestamp if you selected the Read Single Timestamp mode.
      3. (Optional) Wire an indicator to detected edge to return the clock edge the timestamp was recorded on.
      4. (Optional) Wire a control or constant to timeout to specify how long, in seconds, the function should try to read a timestamp before stopping.
      5. (Optional) If you selected the Read Multiple Timestamps instance, wire a control or constant to number of timestamps to specify how many timestamps the function should read.
    5. Place Disable Time Stamp Trigger on the diagram and wire terminal to the same terminal you generated the clock on.
    6. Place Clear Clock on the diagram and wire terminal to the terminal you generated the clock on.
    7. Place Close on the diagram to end the NI-Sync session and free all resources for another program.
    You have an application that records a timestamp whenever there is a rising edge to the clock you generate with Create Clock. You can substitute 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.

    Recently Viewed Topics