11-04-2011 05:35 AM
I am using LabVIEW 2009 SP1 with NI-CAN 2.7 and a series 2 CAN card on a PXI system running LabVIEW RT.
I sync'ed my DAQmx AI measurement with a NI-CAN task using the "CAN Sync Start with DAQmx". The Start is now sync'ed.
As for the samples, I created a test environment: A microcontroller sends a signal via CAN. The signal contains a value that is incremented by 1 with each new CAN message. My PXI measurement programm samples these CAN signal values alongside with DAQmx (5 KHz sample rate, reading 1000 CAN and DAQmx AI values in a while loop). The plot below shows, that sometimes the current value is not sampled, instead the last value is resampled up to 16 times, i. e. the value does stay the same as the last value where it should increment. I made sure, that the source of this effect is not the microcontroller using a third party CAN logging tool.
The picture below shows the CAN init procedure:
Does anyone know why I get these repeated CAN signal values?
11-10-2011 03:07 AM
Addition: I attached a little program that follows the tutorial Synchronizing CAN and Analog Signals for Device Validation. A CAN device that is simply sending CAN messages with a strongly incremented signal at a rate approx. 4000 Hz is connected to the series 2 PXI card.
This program will sometimes resample the same value for 2 times (i. e. the value occurred 3 times in a sequence). This should not happen at a sample rate of 5000 Hz vs. 4000 Hz for incoming CAN messages.
If I remove the whole DAQmx sync part, the CAN sampling will be fine, i. e. the sampling will never resample a value more than once -- exactly as expected.
Is the attached CAN sync program done wrong or is there a technical limit somewhere?
11-16-2011 10:41 AM
What Kind of Hardware are you use (PXI-Chassi,-Controller,-Cards)
and witch Software Version (LabVIEW, LabVIEW RT) and Driver Version (DAQmx and CAN Drivers)
are installed?
11-17-2011 01:36 AM - edited 11-17-2011 01:43 AM
system: PXI-1042, PXI-8108
software: LabVIEW 2009 SP1, NI-CAN 2.7.2, DAQmx 9.2.2, LabVIEW Real-Time 9.0.1
cards: PXI-6255, PXI-8464/2 Series 2
PS: I will post a data file with the measured CAN signals (including interface timestamps) later this day. I will do the measurement with third party Vector CANalyzer and a CANcaseXL. I did this measurement before to make sure there is no other error source, but I will repeat it today. I will also post the array with the repeated signal values.
11-17-2011 06:09 AM
I ran a new measurement for approx. 2 minutes and got 2 independent measurement data files:
I attached both measurement files in CSV format. You will see, that the timestamp dt from CANalyzer does not show any message holes. As for the PXI, I see ~5x repeating values.
Note: The CANalyzer timestamps are given in 10 us units. The PXI data just contains the incremented signal without timestamps.