I have:
Dell XPS M1710 Laptop
PXI-1033 chassis w/ ExpressCard
PXI-6608 TIO/GPS/OCXO in slot 2 (star)
PXI-8461/2 CAN in slot 4
I am trying to test the "drift" between the two cards. There should be NONE becuase I am trying to export the 10Mhz OCXO on slot 2 to the backplane. I tell the CAN card to use the PXI10clk so its timebase should have no drift relative to the 6608 GPSCTR, which I assume runs off of the internal 10Mhz OCXO.
I test the drift by exporting the CAN receive interrupt to the PXI_Trig2 and using it to latch the GPSCTR0 on the 6608. Also the CAN card automatically saves a time stamp internally. I am experiencing 1ms of drift every handful of seconds. What else needs to be done? How can I tell if I'm exporting the Slot 2 10Mhz OCXO to the backplane properly, the position of S1 isn't documented? How can I tell if the CAN card is properly importing the PXI_10Mhz backplane clock?
Here is my code for the drift measurement:
Status = ncConnectTerminals(RxHandle, NC_SRC_TERM_PXI_CLK10, NC_DEST_TERM_MASTER_TIMEBASE, 0);
Status = ncConnectTerminals(RxHandle, NC_SRC_TERM_INTF_RECEIVE_EVENT, NC_DEST_TERM_RTSI2, 0);
DAQmxErrChk (DAQmxCreateTask("",&taskHandleGPS1));
DAQmxErrChk (DAQmxCreateCIGPSTimestampChan(taskHandleGPS1,"PXI1Slot2/gpsTimestampCtr1","", DAQmx_Val_Seconds, DAQmx_Val_None,""));
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandleGPS1,"/PXI1Slot3/PXI_Trig2", 1000, DAQmx_Val_Rising,DAQmx_Val_ContSamps, 0));
So, each time a CAN packet comes in it latches the GPS CTR with its interrupt line AND it timestamps itself on the CAN card. These difference of these two measurements should be constant.
lastCanGpsTimeDiff_sec = curCanGpsTime_sec - lastCanGpsTime_sec;
lastCanGpsTime_sec = curCanGpsTime_sec;
DAQmxErrChk(DAQmxReadCounterScalarF64 (taskHandleGPS1, DAQmx_Val_WaitInfinitely, &curCanGpsTime_sec, NULL));
printf("\nGPSSEC %f, ", curCanGpsTime_sec);
curCanIntTime_sec = ((double)ReceiveBuf.Timestamp.LowPart)/(1.0e7) + ((double)ReceiveBuf.Timestamp.HighPart)*429.4967296;
printf("CAN-GPS = %f\n", curCanIntTime_sec - curCanGpsTime_sec);
The last line produces a drifting result.
Thanks,
Cale
P.S. I may try this on my 1042Q chassis with MXI4 because it automatically exports the 10Mhz clock from Slot 2 to the backplane.