Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to synchronize two timing aware cDAQs across two computers?

I apologize if something like this has been posted before. While I was able to find multiple discussions about synchronization, I wasn't able to find one representing my exact use case. I have two computers each connected to a cDAQ chassis. One chassis is a 9189 and the other is a 9185. Researching some of the documentation posted it seems there are two different categories of synchronization: Signal-based and timing-based. I have worked some with signal-based synchronization before sharing start triggers and sample clocks over PFI ports using BNC cables. However, given both of these chassis are timing aware, it seems the recommendation for the most robust solution is to leverage that technology to synchronize them. My understanding then is that I have two options:

  1. Signal-based synchronization where I share the start trigger and sample clock time base via physical BNC connections between the two chassis. This adds wiring, complexity, and would require adding some digital I/O modules to the chassis as the single built-in PFI port is insufficient to share both the start trigger and time base.
  2. Time-based synchronization. This seems to be the recommended solution and I believe I need something along the lines of Figure 2 on this page https://www.ni.com/en/support/documentation/supplemental/21/time-based-synchronization-of-analog-inp... 

 

My understanding is that with both cDAQ chassis connected to the same network, they will automatically synchronize their master time bases. Therefore, I just need to get both tasks started at the same time for them to be in sync. In the Figure 2 example linked above, they do this by using a host time start trigger of the same time set for both tasks. That is straight forward enough, but I am not sure how to implement that with two separate VIs running across two computers. I was thinking something leveraging network shared variables? If I designate one machine the master and the other as slave then I could share a "ready" boolean and a timestamp variable. If the slave VI is started first, I could program it to poll and wait on the ready boolean to be True from the master. Once the master task is started it could set the task start timestamp shared variable and the ready boolean to true. The slave could then read both values during its task configuration. I would have to ensure that there is sufficient time after the master sets the start timestamp to allow the slave to configure its task before that time has passed. But, I can easily set a 5 to 10 second delay without impacting our application, so I don't imagine this would be an issue. Does this sound like a reasonable way to go about this? I appreciate any advice!

0 Kudos
Message 1 of 2
(1,013 Views)

I think your idea is pretty reasonable to me. Most computers connected to the internet are synced to the NTP server by default. See How Accurate Is Network Time Protocol (NTP)?. Passing a start flag and the start time should be sufficient.

Just a reminder that the TSN protocol requires TSN-enabled switches hence eth1 of 9185 and 9189 should be connected while their eth0 connected to the host. Finding a TSN-Enabled Switch for Synchronizing NI TSN Devices

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
Message 2 of 2
(953 Views)