Selecting a Timing Source for a Timed Structure (Real-Time, Windows)

LabVIEW 2016 Help

Edition Date: June 2016

Part Number: 371361N-01

»View Product Info
Download Help (Windows Only)

A timing source controls the execution of a timed structure. You can select from three types of timing sources:

Internal Timing Sources

Internal timing sources for controlling a timed structure include the 1 kHz clock of the operating system and the 1 MHz clock of a supported real-time (RT) target. Use the Loop Timing Source or Sequence Timing Source section of the Configure Timed Loop, Configure Timed Sequence, or Configure Timed Loop with Frames dialog boxes to select an internal timing source.

  • 1 kHz Clock—By default, a timed structure uses the 1 kHz clock of the operating system as the timing source. Using the 1 kHz clock, you can schedule a timed structure with millisecond resolution. All LabVIEW platforms that can run a timed structure support the 1 kHz timing source.
  • 1 MHz Clock—Supported targets can use the 1 MHz clock timing source to control a timed structure. Using the 1 MHz clock, you can schedule a timed structure with microsecond resolution. If the target does not support microsecond resolution due to processor or operating system limitations, the 1 MHz clock is not available.
  • 1 kHz <absolute time>—Selects the 1 kHz clock of the operating system. When you select this timing source, the timed structure uses timestamps for all input and output terminals related to start and finish times. You can use an absolute timing source to specify a specific date and time for each execution of the structure.
  • 1 MHz <absolute time>—Selects the 1 MHz clock supported on RT targets with Intel Pentium III or later-class processors, such as the NI PXI-817x and NI PXI-818x devices. When you select this timing source, the timed structure uses timestamps for all input and output terminals related to start and finish times. You can use an absolute timing source to specify a specific date and time for each execution of the structure.
  • 1 kHz Clock <reset at structure start>—A timing source similar to the 1 kHz clock that resets to 0 ticks when the timed structure starts.
  • 1 MHz Clock <reset at structure start>—A timing source similar to the 1 MHz clock that resets to 0 ticks when the timed structure starts.
  • Synchronize to Scan Engine—Synchronizes the timed structure to the NI Scan Engine. Using this timing source, the timed structure executes at the end of each scan. The period between iterations corresponds to the Scan Period (µS) setting you configure on the Scan Engine page.

Software-Triggered Timing Sources

You can create a software-triggered timing source to trigger a timed structure based on a software-defined event. Use the Create Timing Source VI to create a software-triggered timing source. Use the Fire Software-Triggered Timing Source VI to programmatically trigger a Timed Loop controlled by a software-triggered timing source.

You can use a software-triggered timing source as an RT-compatible event handler or to notify a consumer Timed Loop when new data becomes available in a producer-consumer application. You also can use software-triggered timing sources for discrete event simulation. Use the number of ticks input of the Fire Software-Triggered Timing Source VI to specify the number of ticks that elapse between each discrete event. The internal tick counter of the timed structure advances by number of ticks when the Fire Software-Triggered Timing Source VI executes. If the internal tick counter jumps past one or more Timed Loop periods, the Timed Loop regards those periods as missed periods. If you want to trigger multiple Timed Loop iterations with a single call to the Fire Software-Triggered Timing Source VI, you can remove the checkmark from the Discard missed periods checkbox in the Configure Timed Loop dialog box.

External Timing Sources

You can create external timing sources for controlling a timed structure with NI-DAQmx 7.2 or later. Use the DAQmx Create Timing Source VI to programmatically select an external timing source. You also can use several types of NI-DAQmx timing sources, including frequency, digital edge counters, digital change detection, and signals from task sources, to control timed structures. Use the DAQmx - Data Acquisition VIs to create the following types of NI-DAQmx timing sources to control a timed structure.

  • Frequency—Creates a timing source that causes a timed structure to execute at a constant frequency.
  • Digital Edge Counter—Creates a timing source that causes a timed structure to execute on rising or falling edges of a digital signal.
  • Digital Change Detection—Creates a timing source that causes a timed structure to execute on rising or falling edges of one or more digital lines.
  • Signal from Task—Creates a timing source that uses the signal you specify to determine when a timed structure executes.

Refer to the NI-DAQmx Help, available by selecting Start»All Programs»National Instruments»NI-DAQ»NI-DAQmx Help, for information about using NI-DAQmx VIs and functions to control timed structures.

You can use a secondary timing source to control the execution of the frames of a timed structure. For example, you can use a 1 kHz clock to control the iterations of a Timed Loop and use a 1 MHz clock to control the timing of the frames in every iteration.



Timed Structures Home

WAS THIS ARTICLE HELPFUL?

Not Helpful