12-17-2010 03:50 PM - edited 12-17-2010 03:54 PM
I am using a USB-8473s CAN Card and USB-6212 Multifunction DAQ Card to perfom automated testing of CAN devices. I have the two sync'ed using a 10MHz FREQOUT and AI START TRIGGER from the DAQ card. Both the AI and CAN functions seem to read data correctly, but now how do I align the data in time? I am reading a CAN message approximately every 50ms and getting a time stamp. I don't really like to use waveforms, but I can get the T0 and dt from the AI read (running at 10+ kHz).
One example using the CAN Channel API claims you should ignore the T0 from CAN waveforms and set the AI and CAN T0 values the same. That doesn't make any sense, how can a CAN read from another device be sync'ed with the AI start trigger? I can't find any examples that show how to align the data using the Frame API (which I must use for compatability with the USB-8473s). Can I rely on the CAN timestamp? Is it generated by the CAN device or is it generated by Windows?
I was hoping the CAN read would output data at the same rate as the AI read and just pad repeat the last data point until the next was recieved - like an AI and encoder/counter read sync, for example. It looks like I'm going to have a major programming headache trying to sync the CAN and AI data in software even though they are already hardware sync'ed.
I am using LabVIEW 2010.
12-20-2010 04:56 PM
Hi Marcus,
Would it be possible to attach your code so I can get a better understanding of exactly what your doing?
12-21-2010 12:58 PM - edited 12-21-2010 12:59 PM
See attached. This is just some quick test code.
I can get the CAN, AI, and Encoder data, but I need to get it all in an array with the same time base.
12-23-2010 10:35 AM
It looks like the Single-Chan Multi-Samp 1D Dbl instance of the CAN Read.vi from the Channel API would do what I need, but I can't use that with a 8473S. I don't see a similar function in the Frame API. Am I missing something?
12-24-2010 11:07 AM
Hi Marcus,
I took a look at your code, and from what I can see you are not triggering your tasks to start at the same time. Even if they are runnng on the same time base, which it seems that they are,the only way you can guarantee they will start at the same time is to connect them all to the same start trigger. Hope this helps.
01-03-2011 10:21 AM
I've got the AI start trigger routed to RTSI 0 on the CAN device the same way it is done in some of the examples (and the wires are in place). Am I doing something wrong with the routing of the signals? I am recieving CAN data, but it is not aligned with the AI data the way the encoder data is.