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.

PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to synch 6608 in PXI star slot 2 to CAN card?

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.
Cale Brownstead
0 Kudos
Message 1 of 4
(3,225 Views)
I guess you have tried both S1 switch positions? It seems the 1033 is somewhat special and requires the Switch to be set to the correct prosition, in order to work with external Clk_10 sources.
A second thing i saw in your code is the PXI slot for your CAN board. You mentioned that the CAN board is in Slot 4 (PXI-8461/2 CAN in slot 4), but your code uses Slot 3 for the DAQmx SampleClock read. ((taskHandleGPS1,"/PXI1Slot3/PXI_Trig2", )?
Otherwise it should work. I am going to try to reproduce this, to see whats wrong.
 
DirkW
0 Kudos
Message 2 of 4
(3,212 Views)

I'll try and change the Slot3 to Slot2. Maybe its the problem...

Right now, I switched to a PXI-1042Q chassis which autoroutes the PXI_CLK_10 signal.

 

Cale

Cale Brownstead
0 Kudos
Message 3 of 4
(3,209 Views)
I switched to the other chassis/controller and it still drifts. Something isn't routing right...
Cale
Cale Brownstead
0 Kudos
Message 4 of 4
(3,200 Views)