Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronization CAN & Analog Input NI-XNET

Solved!
Go to solution

Hello Everyone,

 

I am trying to achieve a hardware synchronization between an analog input and a CAN signal. To achieve this, I am using the DAQ device USB-6343 and the CAN Bus device USB-8502. Both devices have the functionality to export/import triggers and clock sources.

 

Attached you can find my attempt at synchronizing both devices. I am exporting the sample clock trough PFI14 and the start trigger signal trough PFI15 (on the USB-6343). These ports are connected to the USB-8502 T0 and T1 terminals respectively. Both GND are also connected. I am using the 20MHz Time base of the USB-6343, since only that one can be used by both devices (as far as I could tell from the data sheets).

 

My problem is that when I subtract the time stamps from one another, the difference is equivalent to the difference without any synchronization (around 1ms). Code without synchronization also attached. Am I doing something wrong with the synchronization? Perhaps with the XNET connect terminals VI? Any information would be helpful

 

Thanks everyone

0 Kudos
Message 1 of 7
(1,864 Views)
Solution
Accepted by topic author Maxmai98

The working principle of Accuracy of the Waveform Timestamp Returned by NI-DAQmx is applicable for XNET.

The start time, t0 is provided by the host PC when Start VI is called and the values of t0 provided to each device are different during the polling. Thus, the devices are physically synchronized but cosmetically have different timestamps. To correct the time, you can get the actual start time for both DAQmx and XNET, and adjust the start time of XNET as shown below.

ZYOng_0-1679359079945.png

Disclaimer: I don't have actual hardware to validate the code. It was modified based on my memory and experience.

-------------------------------------------------------
Control Lead | Intelline Inc
Message 2 of 7
(1,833 Views)

Ohhh I see. Thanks for the explanation and code ZYOng! I now better understand the problem.

 

However, after trying your code I get this error, saying that the property is not supported. I cannot find any information regarding device compatibility and that property. Furthermore, I cannot even select the property. I can find it when I search the class DAQmx timing class, but I am unable to select any of the "Advanced:[...]" properties regardless of the hardware selected. The "Advanced" properties should be shown under "More.." when clicking on the property node, but they are not. Any idea why I cannot select or even see that property?

 

Information about the property:

https://www.ni.com/docs/en-US/bundle/ni-daqmx-properties/page/daqmxprop/attr313a.html

 

 

 

Maxmai98_0-1679474344756.png

Maxmai98_3-1679474991707.png

 

Maxmai98_2-1679474439415.png

 

0 Kudos
Message 3 of 7
(1,796 Views)

In that case, you can use the t0 of the first sample. The start trigger is generated on the first sample clock.

ZYOng_0-1679503289570.png

 

-------------------------------------------------------
Control Lead | Intelline Inc
Message 4 of 7
(1,790 Views)

That's a nice idea! I did that and it seems to fix the problem on the DAQ side. However, now a new problem is appearing. This time is the Property Intf:AdjustLocalTime.

Maxmai98_0-1679574613843.png

 

I feel so bad for all of this smaller problems just popping up. Normally I have no problem with property issues and such, but unfortunately i cannot find any information regarding compatibility. I just downloaded the newest NI XNET driver (2023 Q1) and the problem persist. I am using LabVIEW 2022 Q3. Maybe the hardware I am using (USB-8502) is just not compatible, but I cannot find any information.

 

Once again thanks for the help and any further advice, would be appreciate it 🙂

0 Kudos
Message 5 of 7
(1,778 Views)

I guess the XNET USB device does not support this feature. I am confident that it works on PXI-851x. We used this method to synchronize with PXIe-852x automotive ethernet module.

Perhaps you need to do manual post-processing on the waveform then.

ZYOng_1-1679604765093.png

 

 

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 6 of 7
(1,762 Views)

Yeah, that sounds like my only option.

 

Anyway, thanks for all the help! Really appreciate it

0 Kudos
Message 7 of 7
(1,747 Views)