Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Time skew - continued

Sorry about previous multiple/incomplete posts - I hit the TAB key while cutting & pasting!  (I wish you could remove a post!)
 
(Here's the rest of the post...)
 
Env: PCI-6229 card, and NIDAQmx 8.0, under ANSI-C.
 
...   continued:
 
The problem I am noticing is that I always see the change of state rise (from 0 to +5V) on the AIN channel exactly one sample time before I see the counter value increment.  I think I have the card setup correctly, so that the CTR tasks get their gate signal from the AIN task's sample clock.
 
Any clues on this?
 
Here's how the card is setup (abbreviated):
 
    // for AIN sections...
    DAQmxCfgSampClkTiming(h,NIL,samplerate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,Ni_MaxSamples);   // sample rate is 1000 samples/sec
    DAQmxCfgDigEdgeStartTrig(h,@src[1],DAQmx_Val_Rising);          // get start trigger from RTSI-1 (for slave AIN cards)
    DAQmxSetExported10MHzRefClkOutputTerm(h,@s[1]);                  // export 10Mhz ref clock to RTSI-7
    DAQmxDisableStartTrig(h)                                                                 // disable start trigger on AIN task
    DAQmxExportSignal(h,DAQmx_Val_SampleClock,@s[1]);              // export AIN sample clock to RTSI-1
 
   // for the counter section...
   DAQmxCfgSampClkTiming(h,@src[1],samplerate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,max_scans); // obtain sample clock timing (and gate from) from RTSI-1
   DAQmxSetCIDupCountPrevent(h,@src[1],1);                                         // prevent dup counts on M-series card when incoming freq is < gate freq
   DAQmxStartTask(h);                                                                         // start ctr tasks
 
   // finally, start AIN taks
   DAQmxStartTask(h_AIN.h)                                                               // start AIN tasks
 
 
The use of RTSI-1 and RTSI-7 is mainly for situations where I have multiple cards in the PC.  For this simple test, however, there is only one card.  The basic idea is that I output my sample clock from the master AIN task to RTSI-1, and then use RTSI-1 as the gate for the counters.
 
Thanks for any help, and sorry about the multiple posts earlier!
 
 
0 Kudos
Message 1 of 2
(2,918 Views)
I posted a response to this post here.
--
Michael P
National Instruments
0 Kudos
Message 2 of 2
(2,904 Views)