NI-TSN (1588 and 802.1AS Synchronization)

cancel
Showing results for 
Search instead for 
Did you mean: 

[Example] Synchronized Analog Input Acquisition using DAQmx

A simple LabVIEW example demonstrating synchronized NI-DAQmx analog input acquisition using a NI-TSN cRIO-9040 and two compactDAQ 9185/9 chassis. The collected analog inputs from all the devices are then processed and analyzed to demonstrate synchronization between all signals. This step is optional and just added to demonstrate AI synchronization.

In addition, a simple synchronization monitoring loop is used to demonstrate the use of NI-Sync API to monitor state of 802.1AS timing protocol across the devices. This step is also optional and simply added for demonstration purpose.

 

cDAQ_cRIO_AI_sync.png

 

 

* This example is provided as is for demonstration and learning purposes

** Attached LV project is saved to LabVIEW 2018 . Installation of NI-Sync driver is required to view/use synchronization monitoring loop VIs. 

Message 1 of 5
(2,296 Views)

Is there any list of PXI DAQmx cards that support the Trigger "Start Time" property? It appears any cDAQ card in a supported chassis will support a TSN, what about PXI chassis? If it is running RT Linux does that suffice?

 

Thanks

0 Kudos
Message 2 of 5
(2,248 Views)

Not an expert on DAQmx, this might be better question for DAQ. But here is what I know about that VI from the TSN prospective

 

The VI sets the same start time for all devices specified on the task wire. This could be either I/O time or host time. In this particular example the host is a cRIO-9040 which happens to be already synchronized with rest of the cDAQs specified on the task wire. The example will use the cRIO time in this case. But this example could very well have I/O time  wired in and everything will work the same. This is because I/O time is also the same between the cRIO and all cDAQs (thanks to 802.1AS sync).

 

If you executed that code from a Windows host. Windows host time would be correlated(one time at start) to the 802.1AS time running on those devices and devices would start at that time. Then the TSN cDAQ devices will remain in sync within each other.

 

There are no DAQ PXI cards which can synchronize to 802.1AS or 1588 protocol. However, since the PXI card is used in a chassis with a PXI Linux controller, the PXI controller host time could be sync to 802.1AS via a PXI-6683 card.  That is, the 6683 ethernet port could be connected to a 802.1AS or 1588 network, the 6683 would then sync the PXI controller host time to 802.1AS/1588 network time. Lastly, you could use host-time as the start source for your PXI DAQmx task. However, the only benefit you will get out of this configuration is the same start time. The I/O acquisition will not remain in sync since the PXI DAQ clock is not synchronized in any way with the network. I dont see any valid use case for such setup in real world, but maybe there is some :-). 

 

In summary, a network of synchronized TSN devices (like in the example) will start at the same time and their IO will remain synchronized for the whole I/O acquisition. Thus resulting in a synchronized data from all devices within that network.

You could synchronize any NI Linux host time to 802.1AS/1588 in a way I described above but the only benefit you get from it is the same start time. The I/O from rest of the devices will not remain in sync.

 

I believe there is a way to synchronize multiple PXI chassis and DAQ cards together but that is not TSN(over network sync). I believe that is more of a signal synchronization where you literally wire clock out of one chassis to another. I have never done it, some PXI experts might be better source if you wish to take that route.

A common TSN setup is a PXI-6683 connected to a chain of cDAQ9185/9 or fDAQs, a TSN cRIO connected to a chain of cDAQ9185/9 or fDAQs,  or simply a chain of of cDAQ9185/9 or fDAQs.

 

 

Message 3 of 5
(2,240 Views)

Thanks for the detailed answer, wish I could give you more than 1 kudo!

Message 4 of 5
(2,237 Views)

Hi Miro, 

 

thanks alot for providing this example!

 

I am running a CDAQ-9185 and a CDAQ-9189 in a line topology, both equipped with a NI-9203, i have therefore switched from voltage to current. 

 

While running your code, I am getting an error stating that my trigger was in the past. I have therefore tried to increase the "future time event delay (s)" and I need to increase this to 40 before it proceeds without failing. It will however here hang at the read function, exceeding the timeout. I have great problems identifying the root of the problem, do you have any insights?

 

also i have a problem in the bottom loop where it comes with the error: -1074118634 The specified device was not found. My hardware is registered in the drop down list in devices to monitor, besides localhost. 

 

I have installed modules DAQmx, NiSync, NI-Timesync. 

 

kind regards

Spectralreaction

0 Kudos
Message 5 of 5
(2,198 Views)