Viewing Time Correlated NI VeriStand Data Logs

Overview

Data logs from VeriStand come in a variety of formats. Ranging from single point data to XNET raw frames to high speed waveform data from one or more targets. Combining and viewing the data in these logs is a challenge due to the variety of technologies and data formats. DIAdem is a powerful tool that can make this process painless. This article provides a tutorial including a time alignment DIAdem SCRIPT, example files, and step by step instructions.

Contents

Synchronization Required

To accurately view VeriStand data logs based upon time, the time information in the logs must be correctly time-correlated. Therefore as a prerequisite to this tutorial, ensure the system is synchronized with a common signal or time-based source. Visit Using Synchronization to Build Integration Test Systems with VeriStand to validate your system configuration.

Data Logging Methods and Formats

NI VeriStand contains many data logging methods and formats. The most common ones are listed and discussed here.

NameFile on Host or TargetTDMS Channel Data TypeDIAdem Plotting StyleTime Stamp Format
Host Side Data LoggingHostDoublesX / YRelative or Absolute values in a channel
Embedded Data LoggerTargetDoublesX / YRelative or Absolute values in a channel
DAQmx Task LoggingTargetWaveformRelative to first point starting at  "X offset" property valueAbsolute time property for first point. Delta T property for subsequent points
XNET Raw Frame LoggingTargetRaw, convert to doublesX / YAbsolute time property for first point. Relative values in a channel.
Waveform Data Logger Custom DeviceTargetWaveformRelative to first point starting at  "X offset" property valueAbsolute time property for first point. Delta T property for subsequent points

 

  • Name - Name of the component that provides logging and a link to the most applicable documentation.
  • File on Host or Target - Location of the logged data file. Host meaning computer running the VeriStand gateway, target being the computer the NI VeriStand Engine is executing on. Since the VeriStand engine is capable of running on Real-Time targets as well as Windows targets, the host and target could be the same computer.
  • TDMS Channel Data Type - The data type of the logged data inside the TDMS file. Logged data is in TDMS format. This file format allows different data types to be used within it for logged data. Each set of logged data is called a channel.
  • DIAdem Plotting Style - The method in which DIAdem plots this data on its "2D Axis System" view. DIAdem uses two styles when plotting data. Either X / Y style where one channel of values is the X locations for one or more channels of values, or relative time plotting for waveforms. The first point of waveform data is positioned at the X location defined by the value of the "wf_start_offset" property (defaults to 0). Subsequent values are plotted at X locations incremented by the "wf_increment" property.
  • Time Stamp Format - The time information contained in the log.
     

Host Side Data Logging

This logging method is for single point channel data and is typically invoked by the stimulus profile editor or through the available LabVIEW and .NET APIs. This API is feature rich, high performance, and is the preferred method of logging channel data if it is possible to keep the host connected to the target. Time information needed for correlation is not automatically included in the log. To add time information, in addition to the channels of interest, log either the System Time system channel if you're not correlating with waveforms or XNET or the Absolute Time system channel if you are. Then the data log will contain a time stamp for each point of channel values.

When logging the Absolute Time system channel, the values are in seconds relative to 12:00 a.m., Friday, January 1, 1904, Universal Time [01-01-1904 00:00:00]

VeriStand channel values are double data type, so they are logged into the TDMS file as double channels. 

Embedded Data Logger

This logging method is for single point channel data and is configured inside the VeriStand system definition as a custom device. The logging occurs on the target so this is ideal for situations where the host is not always present or fail safe data logging. 

Time information needed for correlation is not automatically included in the log. To add time information, in addition to the channels of interest, log either the System Time system channel if you're not correlating with waveforms or XNET or the Absolute Time system channel if you are. Then the data log will contain a time stamp for each point of channel values.

When logging the Absolute Time system channel, the values are in seconds relative to 12:00 a.m., Friday, January 1, 1904, Universal Time [01-01-1904 00:00:00]

VeriStand channel values are double data type, so they are logged into the TDMS file as double channels. 

DAQmx Task Logging

This logging method is for waveform data and is configured inside the VeriStand system definition on the DAQ task. Waveforms can contain huge amounts of data, so logging occurs on target to avoid network throughput issues. 

VeriStand's Tasks configure waveform acquisition, so data is logged into the TDMS file as waveform channels. Waveform channels have a property for an absolute time stamp of the first sample, t0, and a property for the time delta of subsequent points.

XNET Raw Frame Logging

This logging method is for XNET raw frame data directly to disk and is configured inside the VeriStand system definition under the XNET port's incoming section. It can be configured to log incoming frame data or contain both incoming and outgoing frame data if echo is enabled on the port. 

XNET devices time stamp incoming and outgoing frames, which is useful when doing data analysis on raw bus communication. For example, you can diagnose an issue with a DUT coming into and out of sleep. These time stamps are stored inside the XNET raw data logs. XNET devices use a hardware time stamping strategy to provide extremely accurate time stamps. When a frame is sent or received, it is time stamped directly at the XNET board without CPU involvement.

The data inside the resulting TDMS file is in a raw format that is unreadable until converted. DIAdem includes a converter tool that loads raw XNET TDMS files and an XNET database and then creates a converted TDM file containing easily readable double channels. Access this tool on the NAVIGATOR tab and on the left column click the bus log converter icon. Alternatively, DIAdem can be configured to automatically convert XNET raw data logs to double channels upon load. When using the same database frequently, use the automatic convert setting. Configure this setting by first creating a conversion configuration file (*.tcc) with the aforementioned tool, and then select the NAVIGATOR tab » Settings » Options » NAVIGATOR. Pick the *.tcc file and check Converting the XNET-TDMS channel when loading.

After conversion each frame contained in the raw log will have a corresponding group of signals in the converted log. This group has a Time channel that contains time stamp values for each corresponding point of signal data in the group. The time channel starts at 0. The "CANTimeStamp" property on the group provides an absolute time of the first time value, t0. Unfortunately this absolute time property value is in double format of seconds since 0 AD, which has a precision of only 0.1ms. The attached patch for NI DIAdem 2012 makes the conversion process also tag a new high precision time stamp property named "CANDateTimeStamp".

To install this patch, back up the existing dll files of the same name and then copy the attached files into:
<Program Files>\National Instruments\DIAdem 2012\

Waveform Data Logger Custom Device

This logging method is for waveform data and is configured inside the VeriStand system definition as a custom device. Waveforms can contain huge amounts of data, so logging occurs on target to avoid network throughput issues.

VeriStand's waveform nodes are of waveform data type, so data is logged into the TDMS file as waveform channels. Waveform channels have a property for an absolute time stamp of the first sample, t0, and a property for the time delta of subsequent points.

Plotting Time Correlated Data

System Time Correlation

In certain synchronization scenarios, when only logging channel data, the System Time system channel can be used as the X axis. Plotting this data is easily done by simply dragging and dropping. An entire group of double channels can be dragged onto the plot and DIAdem will use the first double channel values in the group as the X axis locations. Therefore be sure to select the time channel as the first channel to log, or adjust the group's channel ordering in DIAdem before dragging and dropping a group. When plotting a subset of a channel group, select the time channel first before dragging and dropping.

Absolute Time Correlation

In certain synchronization scenarios, or when logging channel data with XNET raw frames or waveform data, absolute time must be used as the time reference. As noted in the table at the beginning of this article, XNET raw frames and waveform logs always contain absolute time stamps. When plotting data with absolute time, finding the relationship between data points in time is the goal. Ideally this can be done visually with a plot. With the variety of data types, plotting styles, and time formats, plotting can be a challenge.

To resolve this challenge, a technique can be used to adjust the data so it is displayed by relative time to the first point instead of by absolute time. This makes it easier to follow the data because the X axis is in seconds instead of a very detailed day of week, month, year, etc. After converting any XNET raw data logs to engineering units, apply this technique:

  1. Find the first time stamp (t0) of all absolute time channels and waveforms
  2. Sort all absolute time channels and waveforms by their t0 to find the earliest t0
  3. For absolute time channels, subtract the earliest t0 value from all time stamps using DIAdem scaling
  4. For waveforms, subtract the earliest t0 value from waveform start time (t0) and place the result value into the waveform X offset property. Therefore the waveform's first point is plotted relatively in time to other data.

Time information for each channel or waveform is now relativized for simple drag and drop plotting.

This process can be automated with a DIAdem VB Script and assigned to a button and keyboard shortcut in the VIEW tab. A VB script that identifies VeriStand time channels, XNET time channels and waveforms and relativizes them is attached. This script works for the majority of use cases but could be customized if you have different needs.

Special Note for Delta Sigma Data Acquisition Devices

Certain data acquisition devices contain Delta Sigma analog to digital converters, usually with anti aliasing filters. These devices cause time delays on the acquired data between 10-500 microseconds. The time delay is specific to the device and will be specified in the manual for that device. Often these delays are dependent on the frequency of the signal being measured and a graph will be provided in the device manual. 

Unfortunately, as of DAQmx 9.8, for most devices the time stamp for the acquired data will not be compensated for this delay and it is up to the user to measure and compensate for this delay. Corrective action request #422495 is active for DAQmx to automatically adjust the waveform t0 timestamp for this delay. Until then, use a technique such as the sample scenario below where a single signal was measured by multiple devices to find this delay.

Sample Scenario Data Logs

In this sample, a sine wave signal was acquired with DAQmx waveform logging, XNET raw frame logging, and channel data logging from FPGA and EtherCAT single point acquisition. The system was configured according to synchronization scenario #12 in Using Synchronization to Build Integration Test Systems with VeriStand. A diagram of the system can be seen in Figure 1.


Figure 1: NI VeriStand system used to acquire the attached sample data logs.

Follow these step by step instructions with the attached logs to view the data time correlated. 

  1. Download the attached time_align_sample_files.zip and extract its contents to a location indexed by DataFinder, like Documents (called My Documents in DIAdem and Windows XP).
  2. Open NI DIAdem
  3. In the NAVIGATOR tab, select File » Bus Log Converter...
  4. In the Bus Log Converter window, select file type as NI-XNET (TDMS). If this option is not available, make sure you're running NI DIAdem 2012 or later
  5. In the Bus Log Converter window, in the Bus database configuration section, select Edit...
    1. Type name as "Can Demo Box" 
    2. Select the Add Bus To Configuration button
    3. Select the Add Database File button
    4. Change the file type filter to *.xml and browse to the provided Can Demo Bus.xml file.
    5. Select the cluster "Cluster" 
    6. Select OK, Select OK, Select OK. Returning to the Bus Log Converter window
  6. In the Bus Log Converter window, in the Settings section, select Save As...
  7. In the Save As dialog, select anywhere on disk to save this bus log converter configuration (*.tcc)
  8. Close the Bus Log Converter window
  9. In the NAVIGATOR tab, select Settings » Options » NAVIGATOR. In the Bus Log Convert section select the just created *.tcc file and check Converting the XNET-TDMS channel when loading
  10. In the NAVIGATOR tab, select File » New to clear the Data Portal of any data
  11. In the NAVIGATOR tab, using the File Browser, expand My DataFinder to the location you extracted the sample files (like My Documents)
  12. In the NAVIGATOR tab, using the File Browser, select the single point and waveform file groups as well as the XNET raw frame data channels. Your selection should match Figure 2


      Figure 2: Sample data selection in DIAdem File Browser
  13. In the NAVIGATOR tab, drag and drop the selection of the File Browser to the Data Portal
  14. In the Data Portal, delete all the XNET frame signals named starting with Sawtooth or Switch. These signals are not important to this sample. Your data portal should contain the same content as Figure 3


    Figure 3: Data Portal after importing sample data and removing extra XNET signals
  15. In the VIEW tab, select File » New to create a new blank space for viewing data
  16. In the VIEW tab, right click the blank space and select Display Type » 2D Axis System
  17. In the VIEW tab, select a group from the Data Portal and drag it on to the 2D Axis System.
  18. Repeat step 17 for all groups. Your 2D Axis System should appear as Figure 4.


    Figure 4: 2D Axis System with all sample data before running time correlation script
  19. In the VIEW tab, select the DIAdem Scripts button ()
  20. In the VIEW tab, with the menu open for the DIAdem Scripts button, right click one of the function keys (like F2) and select Predefine Setting...
  21. In the Predefine Setting window, select the browse button and browse to the attached DIAdem VB Script file time_align_data.vbs
  22. In the Predefine Setting window, select OK
  23. In the VIEW tab, either select the newly defined script button or press Shift + Function Key (like F2). The data has now been adjusted to display based upon relative time, different timestamp formats compensated for, and the 2D Axis View should appear as Figure 5.


    Figure 5: 2D Axis System with all sample data after running script. Note: XNET signal values go to zero when the log ends.

Was this information helpful?

Yes

No