This simple example demonstrates the use of the relative time axis, synchronized with the system clock. This example uses the Timed Loop structure to determine the loop timing as well as the delta X for the points on the strip-chart.
Using the Timed Loop, along with the correct setting of two of its properties, ensures the accuracy of the time values displayed on the bottom of the chart. Double-click the Input Node of the Timed Loop, to observe the Discard missed periods option is not checked and the Maintain original phase option is checked. If you control timing using the Wait Until Next ms Multiple function, as demonstrated in the example program entitled "Real-Time Chart" (linked below), jitter causes delays in the execution of the While Loop. Over time, these delays complie and the time values displayed at the bottom of the chart drifts from the actual system clock. By using the Timed Loop, you can compensate for unexpected delays in subsequent iterations of the loop. This ensures the time values displayed on the bottom of the chart stay synchronized with the system clock.
You can use this example as a prototype for applications that acquire data at a constant, known rate. You determine the maximum rate using the timer resolution and speed of your machine.
Note: The Period of Loop (ms) input in this example allows a minimum of 50 ms. This prevents the user from attempting to set the period to less than the actual time needed to execute the iteration. You can change this minimum value by changing the properties of the Period of Loop (ms) input.
Note the use of Unbundle by Name function to extract the current time information, as well as the use of the Chart Property Node to set the X axis as desired. The current example displays 10 seconds of data regardless of the sample rate determined by the Period of Loop (ms) input.