Synchronizing Analog Input FieldDAQ Devices with NI-DAQmx in LabVIEW

Publish Date: Jan 19, 2018 | 1 Ratings | 5.00 out of 5 | Print | Submit your review


FieldDAQ devices support diverse measurement types such as voltage, temperature, and strain. The FieldDAQ Hardware, in conjunction with the DAQmx API, allows users to the flexible configuration options to achieve the desired correlation across multiple devices. This tutorial highlights some of the diverse options available to achieve synchronization between devices.

Table of Contents

  1. FieldDAQ Input Devices
  2. Use a Multidevice Task to Synchronize Multiple FieldDAQ Devices
  3. Manually Synchronize Multiple FieldDAQ Devices with Separate Tasks 
  4. Manually Synchronize FieldDAQ Devices and Time-Aware cDAQ Chassis
  5. Conclusion
  6. Additional Resources

1. FieldDAQ Input Devices

FieldDAQ Input Devices are rugged ethernet-based devices that are designed to take measurements in close proximity to the physical phenomenon. FieldDAQ takes advantage of the Time Sensitive Network (TSN) standard IEEE 802.1 to synchronize its measurements to an external time source. FieldDAQ Devices can be categorized into two groups based on their synchronization: Delta Sigma and Slow Sampled Devices. Delta Sigma Devices use a 24-bit ADC that is free running, convert using a higher sample internal clock (sample clock timebase rate), and return data at a slower rate (sample clock rate). Slow Sampled Modules use a 24-bit ADC, and convert and return data at the rate specified by the clock (sample clock rate). The method of implementing synchronization may depend on the categorization of the device. The efficacy of the synchronization method will depend on the Hardware Topology as well as the type of ethernet switch chosen. This tutorial focuses on the necessary LabVIEW code to synchronize devices and assumes the reader has the necessary hardware for their chosen topology to enable synchronization. User should review Selecting a Topology in Designing Distributed TSN Ethernet-Based Measurement Systems to ensure they have the necessary hardware and topology. In this tutorial, synchronization is defined as the steps or techniques used directly or indirectly via the DAQmx driver to start measurements at the same time and to remove drift between subsequent measurements. While the result of these steps increases the sample to sample alignment, the focus is to prevent drift.

Examples in this tutorial use the Snippet functionality in LabVIEW. To learn more about this functionality please review this tutorial Use VI Snippet to Store and Share Reusable Code Sections.

Back to Top

2. Use a Multidevice Task to Synchronize Multiple FieldDAQ Devices

One of the most robust and easiest methods to synchronize multiple FieldDAQ devices is to place all devices into one task. To use various modules in the same task, place multiple channels across different devices in the Physical Channel control. The Physical control inputs into the Create Virtual Channel VI. Channels from different modules should be included in the same DAQmx Create Channel if they are intended to have the same measurement configuration (voltage range, measurement type, and units) and the same timing and triggering information. 

Figure 1: Multi-Device Synchronization 

If the modules are taking different measurements (such as voltage or current), require different measurement ranges, or need to use different measurement units, then use multiple instances of the DAQmx Create Virtual Channel VI as seen below.

Figure 2: Multi-Device Synchronization using Multiple DAQmx Create Virtual Channel VIs

When using multiple FieldDAQ units in a Line Topology there is a possibility that putting all the devices in a task will fail and return error -209840, "The configured time trigger occurred in the past." The error is caused by the time needed to configure each device. To avoid this error manually set the time Time Start Trigger to a value that occurs after all the devices have completed their configuration.

Figure 3: Multi-Device Synchronization with Time Start Trigger

Placing all the devices into one task to achieve synchronization is not a feasible solution under certain conditions:

  • All devices in the task will sample and return data at the same rate (FD-11613 will return duplicate samples in order to keep up with FieldDAQ units that can sample at faster rates)
  • Each device placed in the task leads to the potential of a longer configuration time which may not be acceptable for the application
  • Multi-Device Tasks does not work and will error when trying to synchronize FieldDAQ and Time Aware CompactDAQ Chassis (discussed later in Manually Synchronize FieldDAQ Devices with Time-Aware cDAQ Chassis)
  • In a line topology each successive device in the line decreases the synchronization accuracy with respect to the first node and the last node

To work around this issue, users must employ separate tasks and manually synchronize these tasks. 

Back to Top

3. Manually Synchronize Multiple FieldDAQ Devices with Separate Tasks 

To manually synchronize FieldDAQ units in separate tasks, configure a Time Start Trigger for each task and a congruent timestamp for the when input for the DAQmx Start Trigger 

Figure 4: FieldDAQ Synchronization with Separate Tasks

Since all devices are TSN capable the onboard clocks used to take measurements have already been steered. The only signal between tasks that is needed is a Time Start Trigger. To synchronize Delta Sigma FieldDAQ Devices a different approach is needed due to how the ADCs operate. 

For Delta Sigma FieldDAQ units (11603 and 11637) that are running at similar or different rates, users must account for the Reset Times, the difference in Reset Times, and the variable number of samples that occur due to the difference in sample rates. Delta Sigma ADCs are stopped and started in order to clear old samples and line up their acquisitions with any external devices sharing the same SampleClock Timebase. After the device is started there is a variable amount of time before the device returns the first sample. This variable amount of time is defined as the Reset Time. The signal that stops and starts the Delta Sigma ADC is called the Synchronization Pulse. Different model Delta Sigma Devices may have different Reset Times and the Reset Times is dependent on the Sample Rate. An account for this Reset Time is needed to ensure each device has gone through the reset sequence and begins to acquire or output samples at the same time. The time needed to reset the ADC can be found using the DAQmx Timing Property Node SyncPulse.ResetTime. 

To ensure each device has gone through it's Reset Time we delay the Start Time by the value of the the Reset Time.To properly account for potentially different Reset Times, the Reset Time required for each device is checked and, if necessary, a delay is added to devices with a shorter Reset Time. Therefore, the sum of the Reset Time and the delay should be the same for each device.To ensure all ADCs end their reset cycle coincidentally, a comparison is made between both tasks’ Reset Times. We take the task with the largest Reset Time and subtract the Reset Time of the task with the smaller Reset Time. The result is the time where one task has begun to acquire data while the other task is still going through its Reset Cycle. To account for this delay we manually configure the Synchronization Pulse using the property node SyncPulse.Time.when. This allows a delay in the Synchronization Pulse that will be sent to the device with a shorter Reset Time. The Task with shorter Reset Time SyncPulse.Time.when for the shortest set equal to the difference between the module that has the greatest Reset Time and the Reset Time of the module. This will shift the synchronization pulse of a module that takes less time to reset thus ensuring that both modules with a slow and fast Reset Time end their reset sequence at the same time. An analysis is conducted on the ratio between the sample rates to determine the appropriate amount of seconds to shift the Start Time. The code below details how to adjust the necessary parameters for the Reset Time, difference in Reset Times, and difference in sample rates. The subvis necessary for this example are attached to this document in the top right hand corner.


Figure 5: FieldDAQ Synchronization with Separate Task for Delta Sigma Devices

 I/O Device time is used in the above example due to the accuracy in translation between Host Time and I/O Device time.  


Back to Top

4. Manually Synchronize FieldDAQ Devices and Time-Aware cDAQ Chassis

FieldDAQ devices are also capable of synchronizing to other device that are Time-Aware or TSN capable. Examples of these devices are the cDAQ-9185 and cDAQ-9189.  An understanding of C Series Synchronization schemes along with device grouping provided in Synchronizing Analog Input C Series Modules with NI-DAQmx in LabVIEW is assumed for this section. 

Figure 6: FieldDAQ Synchronization with cDAQ-9185 and cDAQ-9189

The above example is identical to the code required to synchronize two FieldDAQ units in separate tasks ( Figure 3) except one of the task is specific to Time-Aware cDAQ Chassis. The above code is intended for synchronizing Slow Sampled FieldDAQ Devices with SAR or Slow Sampled C Series Modules. For a list of SAR and Slow Sampled C Series Devices please see Synchronizing Analog Input C Series Modules with NI-DAQmx in LabVIEW

When synchronizing Delta Sigma FieldDAQ Devices and C Series Delta Sigma Modules that are running at similar or different rates, the difference in Reset Times, the Reset Times, and the variable number of samples that occur due to the difference in sample rates must be considered. The example below is identical to the example shown in Figure 5 except one of the task is specific to Time-Aware cDAQ chassis, and both devices are directed to use a Sample Clock Timebase Rate that are equivalent. The subvis necessary for this example are attached to this document in the top right hand corner.

Figure 7: FieldDAQ Synchronization with cDAQ-9185 and cDAQ-9189 for Delta Sigma Devices

The example above has both devices use a 12.8MHz clock but another common Sample Clock Timebase is the 13.1072MHz Timebase. Setting both devices to the clocks that are running at similar rates may allow for equivalent sample rates to be achieved when dividing down of the Sample Clock Timebase Clocks. Consult the Specifications/Datasheet for each device to see which sample rates are available when choosing specific Sample Clock Timebase. In some examples achieving the same sample rate will require each task use a unique Sample Clock Timebase. While choosing Sample Clock Timebases that result in equivalent sample rates  is not required for synchronization it helps with the alignment of the measurements. 

Synchronizing FieldDAQ Delta Sigma Device and SAR C Series Module comes with particular challenges due to the timing differences between Delta Sigma and SAR devices. The synchronization scheme must account for the Reset Time of the FieldDAQ Delta Sigma Device, the difference in sample rates, and the time it takes to retrieve the first sample. The subvis necessary for this example are attached to this document in the top right hand corner.

Figure 8: FieldDAQ Delta Sigma Devices Synchronization with SAR Modules in cDAQ-9185 and cDAQ-9189

The time it takes to retrieve the first sample could be accounted for by specifically shifting the Start Time of the SAR Module. The property node to delay the start time is chosen due to a minimum delay of 4 ticks of the 80MHz clock. Shifting the Start Time still incurs this delay but setting the delay via the property node over-rights this delay. The delay written must be greater than 4 ticks of the 80MHz clock.


Back to Top

5. Conclusion

Throughout this tutorial several synchronization options have been demonstrated.  When synchronizing at the same rate, programming can be simplified by referring to several devices within the same task. Depending on the type of FieldDAQ Device, or a need for diverse timing configuration options such as sample rates this tutorial provides many options for synchronization. These options represent an overview of different ways to synchronize FieldDAQ which is applicable for the timing requirements in many application areas.

Back to Top

6. Additional Resources

Back to Top

Bookmark & Share


Rate this document

Answered Your Question?
Yes No