Timing and Synchronization in NI LabVIEW

Publisher:心有所属Latest update time:2011-07-09 Keywords:LabVIEW Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Overview
Timing is critical to all test, control, and design applications and must be considered as a key consideration in your system. Timing and synchronization techniques relate events to time when coordinated actions need to be performed. For software to perform these coordinated actions, programs must be synchronized based on time. NI LabVIEW includes timing structures that you can use to synchronize your programs in your system.
LabVIEW Timing Principles—Nanosecond Engine and NI-TimeSync
LabVIEW uses a software component called the Nanosecond Engine to keep track of time in your program. The engine runs in the background and interacts with the operating system to manage time. There are several functions and structures in LabVIEW that use this engine to keep track of time, such as the Wait function and the Timed Loop structure. The Nanosecond Engine can use the local real-time clock (RTC) or it can be driven by an external reference clock through the NI Timing and Synchronization Architecture (NI-TimeSync) (Figure 1).


Figure 1. LabVIEW nanosecond timing mechanisms work with NI-TimeSync to provide clocks for applications.
LabVIEW 2010 introduces a new clock in NI-TimeSync. The IEEE1588 plug-in in NI-TimeSync 1.1 provides a synchronized reference clock with up to 1 ms accuracy. You can configure multiple instruments on a network to use the same IEEE 1588 reference clock, allowing multiple platforms to be synchronized on a standard Ethernet network. You can also configure devices to use the software 1588 precision time protocol through the NI Measurement & Automation Explorer (MAX) tool (Figure 2).


Figure 2. Configuring the device's time synchronization source from MAX [page]


LabVIEW Timing Structure - Timed Loop
A timed loop is a loop structure that executes when a configurable timing source generates an event. It can use a variety of timing sources (detailed in the following tutorials). If you develop applications for multi-rate processing, precise timing and synchronization, loop execution feedback, dynamically changing timing characteristics, or multiple execution priorities, you can use a timed loop. In addition to the strict timing characteristics of the timed loop, the timed structure can also be used to allocate processor resources for multi-core programming. With the timed loop, you can specify multiple timing properties including period, priority, deadline, offset, and delay. Combining these properties with a rich set of timing sources, you can create complex applications no matter what timing method is required.


Figure 3. LabVIEW Timed Loop structure using timing constants to execute code

Timing Sources for Timed Loops
Timing sources control the execution of timed structures. You can select from three types of timing sources: internal timing source, software trigger, or external timing source (Figure 4).


Figure 4. Timing sources for a Timed Loop structure: built-in timing sources, software-triggered sources, and external sources
Built-in timing sources
The built-in timing sources keep track of time using a nanosecond engine. You can configure a timed loop on a real-time (RT) target using either a 1 kHz clock or a 1 MHz clock. You can use a timed structure with millisecond resolution using a 1 kHz clock. All LabVIEW platforms that can run timed structures support the 1 kHz timing source. Targets that support the 1 MHz timing source can provide timed structures with microsecond resolution. You can also configure a Timed Loop structure to use these built-in timing sources as an absolute time reference to start the loop execution with a timestamp. For example, you can configure a Timed Loop to start at a certain time each day.
Another built-in timing source is the Synchronous Scan Engine. It synchronizes a timed structure with the NI Scan Engine. With this timing source, a timed structure executes at the end of each scan. The loop execution period corresponds to the Scan Period (µS) setting, which you configure on the NI Scan Engine page.
Software-triggered timing sources
You can create a software-triggered timing source to trigger a timed structure based on a software event. The Create Timing Source VI creates a software-triggered timing source. The Fire Software-Triggered Timing Source VI programmatically triggers a timed loop controlled by a software-triggered timing source. You can use a software-triggered timing source as a real-time-compatible event responder or to notify a consumer loop in a producer-consumer model when new data is available.
External Timing Sources
You can create external timing sources to control timed structures with NI-DAQmx 7.2 or later. Use the DAQmx Create Timing Source VI to programmatically select an external timing source. You can also use a variety of NI-DAQmx timing sources, including frequency, digital edge counters, digital change detection, and task signal sources to control timed structures. Use the DAQmx Data Acquisition VIs to create the following types of NI-DAQmx timing sources to control timed structures. Frequency
—Creates a timing source that executes a timed structure at a certain frequency.
Digital Edge Trigger—Creates a timed structure that executes on the rising or falling edge of a digital signal.
Digital Change Detection—Creates a timed structure that executes on the rising or falling edge of one or more digital lines.
Task Signal—Creates a timed structure that can be triggered to execute using a signal.
Timing and Synchronization in LabVIEW
LabVIEW provides the necessary timing and synchronization capabilities for your system using the language's built-in timing structures, nanosecond timing engine, and timed loop structures.

If you are not familiar with synchronization, you can visit Implementing Synchronization to learn more. Or view case studies in the industry.

To learn more about LabVIEW, visit ni.com/labview/

Keywords:LabVIEW Reference address:Timing and Synchronization in NI LabVIEW

Previous article:Analysis and Reporting Features of LabVIEW 2010
Next article:Monitoring a Historic Site Using LabVIEW and NI Wireless Sensor Networks

Recommended ReadingLatest update time:2024-11-17 00:58

How to solve the failure problem of vehicle shift lever system based on LABVIEW and AC servo motor?
challenge: The vehicle shift lever durability test requires that the vehicle shift lever runs a large number of times (such as 400,000 times) between two determined working positions at a certain speed under specified load conditions, and monitors parameters such as speed and number of times during operation, and ho
[Automotive Electronics]
How to solve the failure problem of vehicle shift lever system based on LABVIEW and AC servo motor?
Design of Digital Storage Oscilloscope Based on LabVIEW6.1
0 Introduction   In 1986, the National Instruments Corporation of the United States proposed the concept of virtual instrument. It is a programming concept that is an organic combination of the front panel, data flow diagram and icons or connectors. With the development of modern test and instrument technology, the co
[Test Measurement]
Design of Digital Storage Oscilloscope Based on LabVIEW6.1
Design of remote electrical parameter measurement system based on STM32 and Ethernet
  Abstract Aiming at the inconvenience of electricity consumption and charging management in various places, this paper studies the remote electric parameter measurement technology based on ARM and Ethernet. This technology is mainly used for the collection and storage of electric parameters. The main controller adopt
[Test Measurement]
Design of remote electrical parameter measurement system based on STM32 and Ethernet
LabVIEW copy function of conditional structure and event structure
When writing a medium-sized program, state machines and event structures are common design patterns. SR (SHIFT REGISTER) is often used to transfer data between various cases. When there are many cases, it is often the case that SR is forgotten to be connected or a new SR needs to be added. This is very troublesome and
[Test Measurement]
LabVIEW copy function of conditional structure and event structure
FFT spectrum analyzer based on LabVIEW and DSP technology
1 Concept and characteristics of virtual instruments Virtual instruments are an important application of virtual technology in the field of instrumentation. It is a new achievement that is born out of the close integration of the increasingly developed computer hardware, software and bus technology with the
[Test Measurement]
FFT spectrum analyzer based on LabVIEW and DSP technology
Design of a Thermal Comfort Test System Based on LabVIEW
0 Introduction In the field of HVAC, with the development of testing technology and the continuous improvement of testing requirements, some high-precision temperature and humidity test instruments with direct communication functions with computers have been widely used in scientific research and engine
[Test Measurement]
Design of a Thermal Comfort Test System Based on LabVIEW
LabVIEW string/array Type
When LabVIEW CLN calls dll, the interface can only be of c99 type and c++ string type cannot be used. LabVIEW has its own defined string type: LStrHandle. ————————————————————————————————————————————————————-------------------------------------------------------------------------------------------- The C++ code
[Test Measurement]
Real-time and non-real-time comprehensive applications in the measurement of multiple signals
Abstract: Based on the different characteristics and requirements of signals, real-time measurement and non-real-time measurement are comprehensively applied to the testing of multiple signals. This paper introduces the real-time test of LabVIEW RT in the general test program of LabVIEW, and uses LabVIEW Simulation In
[Test Measurement]
Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号