Quantcast
Channel: Counter/Timer topics
Viewing all articles
Browse latest Browse all 1271

implicit buffered counter output with 100MHz internal clock locked to external 10MHz clock (PXIe-6738, ANSI-C)

$
0
0

Hi all!

 

We use a PXIe-6738 analog output card in a PXIe chassis. We use one (or two) of the counters of the PXIe-6738 card to generate pulses at programmable time (implicit mode, buffered) on one of the PFI outputs. This PFI is used as the timebase of the analog outputs of the same PXIe-6738 card and/or of another analog or digital output card (PXIe-6535) in the same chassis. We can use also an external trigger on some PFI input to start generation of the pulses and we can also use an external 10MHz signal on another PFI input as clock source. With the internal 100MHz clock source the minimum programmable low and high times of the pulses are 60ns which is sufficient for our application, but with the external 10MHz clock the minimum low and high times are 200ns which is not good for our application. So our problem is: we would like to have 60ns resolution independent of the clock source.

 

A possible solution would be to use the PLL of the PXIe-6738 card to lock the internal 100MHz clock to the external 10MHz clock. With this configuration we should have always 60ns resolution regardless of using an external 10MHz clock or not. However, so far we did not managed to get this working.

 

We usually use Python on Windows 10 but for testing we use also a simpler C-code with MS Visual Studio. This is a modified version of the DigPulseTrain-Cont-Buff-Implicit.c example code which I attach here. We use the function DAQmxCreateCOPulseChanTicks which allows to set the external clock input terminal and DAQmxWriteCtrTicks to program the pulse times. To set the frequency of the external clock we tried using the function DAQmxSetCOCtrTimebaseRate but which gives error -200486: "Specified channel is not in the task", although the PFI channel was programmed before with DAQmxCreateCOPulseChanTicks. We tried to use DAQmxCreateCOPulseChanTime and DAQmxWriteCtrTime to program the time in seconds and to set an external clock source with DAQmxSetSampClkTimebaseSrc and DAQmxSetCOCtrTimebaseRate to set the external clock frequency. DAQmxSetSampClkTimebaseSrc does not give an error but DAQmxSetCOCtrTimebaseRate gives again the same error -200486. Using DAQmxSetSampClkTimebaseSrc without DAQmxSetCOCtrTimebaseRate does not show any fixed phase relation of the counter output with the external clock, so seems also not to work.

 

So how can I configure the 100MHz internal clock of the PXIe-6738 card to use the 10MHz external clock and still have 60ns minimum low and high time of the counter?

 

Many thanks in advance!

 

Andreas


Viewing all articles
Browse latest Browse all 1271

Trending Articles