Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Generate Synchronized pulses across two separate cards on a PXI system

Hey,

 

I'm trying to generate three pulses from my PXI System for triggering purposes. I have two cards (PXI 6259 and PXI 6115) , each with two counter/timers on them. The 6259 has 32 bit timers, and the 6115 has 24 bit timers.

 

Up until now, I only needed two pulses. One was 180us long at 20 Hz, and the other is 5us at 20 Hz, starting 150us after the beginning of the first pulse. I was able to achieve this by generating both pulses on my 6115 card by triggering the shorter pulse off of the rising digital edge of the longer pulse and giving the DAQmx Counter/Timer task an initial delay of 150us.

 

The third pulse needs to be identical to the short pulse, only it needs to occur 20us early (130us after the start of the wide pulse). I tried to generate it using the same technique as I used when generating the short pulse, only generating the pulse and reading in the rising digital edge trigger on my 6259 card instead of the 6115. 

 

The result was that my pulse trains were asynchronous and the pulse generated on the 6259 card was constantly shifting to the left.

 

This puzzled me, so I wrote up a little dummy program to test generating triggered pulses. The results were that when I generated two pulses on the same card, they were always synchronized; however when I generated pulses on separate cards, one of the pulses always shifted.

 

I was hoping somebody could suggest a reason that the pulses across cards are asynchronous even though I'm reading in a digital trigger and hopefully a way to rectify the situation and synchronize all of my pulses.  

0 Kudos
Message 1 of 4
(5,617 Views)

The problem, in a nutshell, is that the timebases on the two boards have manufacturing tolerances that will cause them to differ from one another.   The accuracy error is a small fraction of a percent, but the effect on the phasing of your pulses will be cumulative.  That's why you saw the one set of pulses "shifting to the left."

 

The solution is to make sure each board derives its pulse timing from a single common timebase.  Fortunately, this is pretty easy to specify with DAQmx, just a little tricky to find.  In the chain of VI's you call to configure the counter pulses, insert a DAQmx Channel property node.   From memory, I *think* you should be looking under something similar to "Counter Output->General->Timebase->Timebase.Src"

 

Right click and create a constant or control to define the timebase source.  You should get a dropdown list that includes a wide variety of choices.  Among them are each of the boards' 20 MHz clocks.  By default each task will use a timebase from its own board but this technique lets you route one board's timebase over the PXI backplane with that single property node setting.  DAQmx does most of the dirty work behind the scenes.

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 2 of 4
(5,594 Views)

Hey Kevin,

 

That fixed the problem right out... I referenced both cards to the 20MHz Clock on the 6115 Card ( the one with the lower counter resolution) and now the pulses are all synchronized very well. Would you suggest a different timebase, or is one as good as any other?

 

Thank you for your help and expertise in the matter,

-Josh H. 

0 Kudos
Message 3 of 4
(5,582 Views)

Chances are that either timebase will suit your app just fine.  It's just a question of the timebase's accuracy (one may have better specs than the other), and your app's needs.   Unless you need to keep these pulses sync'ed to a specific time-of-day over the course of many hours or days, it's unlikely to matter which you choose.

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 4
(5,571 Views)