From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronise DAQ and CAN using RTSI

I do a CAN/DAQ measurement using 2 PCI cards and a RTSI cable. However, not all of my analog samples are timestamped
(I'm missing 930 timestamps on a total of 4700 analog samples).
I'm using the Net RTSI config, because with the Obj RTSI config I get nothing but random timestamps for my analog signal, while CAN timestamps are OK.

What can cause this behavior?
Thanks,
David.
0 Kudos
Message 1 of 4
(2,529 Views)
David;

To synchronize two boards trough the RTSI cable, you need to make one of those two as being the master and the other as the slave. The master board will generate all the clock signals while the slave board will use that clock as its new clock, instead of the internal timebase clock. Having that picture in mind, you will need to different RTSI operations, the first one routing, lets say, the CAN board clock signal, to one of the RTSI lines, and at the DAQ side, you will need to route that same RTSI line as beeing the AI Scan Clock signal, and specify the board as beeing clocked by an external clock signal.
Depending on the Software Language you are using to program the boards, you can find some good examples on how to synchronize multiple devices, either at
the NI-DAQ folder, or in the Labview shipping examples, in case you are using Labview.
Hope this helps.
Filipe
0 Kudos
Message 2 of 4
(2,529 Views)
First of all: thanks for your reply.
Now, the problem:
I started of one of the examples on the NI site (http://zone.ni.com/devzone/explprog.nsf/6c163603265406328625682a006ed37d/773da68471f9efa4862569e00072a0fc?OpenDocument) and modified this somewhat to log data as binary. I also added a VI to filter out only the CAN ID I'm interested in. (I tried to use an Object instead of a Network Interface, but that resulted in random timestamps for analog... don't know why. Didn't find an example that should work to test with).
DAQ board is used as the master, CAN is set to timestamp the RTSI events.
The result: sometimes less, sometimes more timestamps for analog than I have analog samples.
I have included the sample LV6 program that I use for testing. Main C
AN-DAQ-RTSI is for acquisition, Main Reporting to read the measured files. 2 sample measurements are included too. Second example only contains noise, but ALSO has different number of timestamps than samples for analog.

Gee, I hope I didn't bore you. 🐵
It would be great if someone could give me some advise.

Thanks,
David.
0 Kudos
Message 3 of 4
(2,529 Views)
I added error clusters to my app and found out that I get a read queue overflow. Setting the read queue lenght to a higher value (250 or so) generates an error during config. It looks like LV can not reserve enough memory. So, logging the whole NI doesn't seem to be possible because I receive to much frames.

What could solve the problem is using an Object instead of the whole Network Interface. But I have no idea how to make a CAN-DAQ synchronisation using an Object and RTSI. Can anyone maybe point me to an example or send me one?

Thanks,
David.
0 Kudos
Message 4 of 4
(2,529 Views)